diff options
| author | Emmanuel Pescosta <[email protected]> | 2015-02-27 11:30:27 +0100 |
|---|---|---|
| committer | Emmanuel Pescosta <[email protected]> | 2015-02-27 11:30:27 +0100 |
| commit | 9aee5d22513f0367febab54b38b3a7dc58d120bb (patch) | |
| tree | 99cf391070ac5d4650a3f1b309c3ec2e814f1ac6 /src/dolphintabpage.cpp | |
| parent | f025aeb63aa2a38e91c43d99ba9955793d3adf1e (diff) | |
| parent | b701b7e4edefb628d6f8b14146b2e299bd0ce5fc (diff) | |
Merge branch 'frameworks'
Diffstat (limited to 'src/dolphintabpage.cpp')
| -rw-r--r-- | src/dolphintabpage.cpp | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/src/dolphintabpage.cpp b/src/dolphintabpage.cpp index f7000ea66..6d55ebeb2 100644 --- a/src/dolphintabpage.cpp +++ b/src/dolphintabpage.cpp @@ -23,8 +23,9 @@ #include "dolphin_generalsettings.h" #include <QSplitter> +#include <QVBoxLayout> -DolphinTabPage::DolphinTabPage(const KUrl& primaryUrl, const KUrl& secondaryUrl, QWidget* parent) : +DolphinTabPage::DolphinTabPage(const QUrl &primaryUrl, const QUrl &secondaryUrl, QWidget* parent) : QWidget(parent), m_primaryViewActive(true), m_splitViewEnabled(false) @@ -39,10 +40,10 @@ DolphinTabPage::DolphinTabPage(const KUrl& primaryUrl, const KUrl& secondaryUrl, // Create a new primary view m_primaryViewContainer = createViewContainer(primaryUrl); - connect(m_primaryViewContainer->view(), SIGNAL(urlChanged(KUrl)), - this, SIGNAL(activeViewUrlChanged(KUrl))); - connect(m_primaryViewContainer->view(), SIGNAL(redirection(KUrl,KUrl)), - this, SLOT(slotViewUrlRedirection(KUrl,KUrl))); + connect(m_primaryViewContainer->view(), SIGNAL(urlChanged(QUrl)), + this, SIGNAL(activeViewUrlChanged(QUrl))); + connect(m_primaryViewContainer->view(), SIGNAL(redirection(QUrl,QUrl)), + this, SLOT(slotViewUrlRedirection(QUrl,QUrl))); m_splitter->addWidget(m_primaryViewContainer); m_primaryViewContainer->show(); @@ -51,7 +52,7 @@ DolphinTabPage::DolphinTabPage(const KUrl& primaryUrl, const KUrl& secondaryUrl, // Provide a secondary view, if the given secondary url is valid or if the // startup settings are set this way (use the url of the primary view). m_splitViewEnabled = true; - const KUrl& url = secondaryUrl.isValid() ? secondaryUrl : primaryUrl; + const QUrl& url = secondaryUrl.isValid() ? secondaryUrl : primaryUrl; m_secondaryViewContainer = createViewContainer(url); m_splitter->addWidget(m_secondaryViewContainer); m_secondaryViewContainer->show(); @@ -76,7 +77,7 @@ void DolphinTabPage::setSplitViewEnabled(bool enabled) m_splitViewEnabled = enabled; if (enabled) { - const KUrl& url = m_primaryViewContainer->url(); + const QUrl& url = m_primaryViewContainer->url(); m_secondaryViewContainer = createViewContainer(url); const bool placesSelectorVisible = m_primaryViewContainer->urlNavigator()->isPlacesSelectorVisible(); @@ -134,7 +135,7 @@ int DolphinTabPage::selectedItemsCount() const return selectedItemsCount; } -void DolphinTabPage::markUrlsAsSelected(const QList<KUrl>& urls) +void DolphinTabPage::markUrlsAsSelected(const QList<QUrl>& urls) { m_primaryViewContainer->view()->markUrlsAsSelected(urls); if (m_splitViewEnabled) { @@ -142,7 +143,7 @@ void DolphinTabPage::markUrlsAsSelected(const QList<KUrl>& urls) } } -void DolphinTabPage::markUrlAsCurrent(const KUrl& url) +void DolphinTabPage::markUrlAsCurrent(const QUrl& url) { m_primaryViewContainer->view()->markUrlAsCurrent(url); if (m_splitViewEnabled) { @@ -212,7 +213,7 @@ void DolphinTabPage::restoreState(const QByteArray& state) stream >> isSplitViewEnabled; setSplitViewEnabled(isSplitViewEnabled); - KUrl primaryUrl; + QUrl primaryUrl; stream >> primaryUrl; m_primaryViewContainer->setUrl(primaryUrl); bool primaryUrlEditable; @@ -221,7 +222,7 @@ void DolphinTabPage::restoreState(const QByteArray& state) m_primaryViewContainer->view()->restoreState(stream); if (isSplitViewEnabled) { - KUrl secondaryUrl; + QUrl secondaryUrl; stream >> secondaryUrl; m_secondaryViewContainer->setUrl(secondaryUrl); bool secondaryUrlEditable; @@ -256,7 +257,7 @@ void DolphinTabPage::restoreStateV1(const QByteArray& state) stream >> isSplitViewEnabled; setSplitViewEnabled(isSplitViewEnabled); - KUrl primaryUrl; + QUrl primaryUrl; stream >> primaryUrl; m_primaryViewContainer->setUrl(primaryUrl); bool primaryUrlEditable; @@ -264,7 +265,7 @@ void DolphinTabPage::restoreStateV1(const QByteArray& state) m_primaryViewContainer->urlNavigator()->setUrlEditable(primaryUrlEditable); if (isSplitViewEnabled) { - KUrl secondaryUrl; + QUrl secondaryUrl; stream >> secondaryUrl; m_secondaryViewContainer->setUrl(secondaryUrl); bool secondaryUrlEditable; @@ -301,28 +302,28 @@ void DolphinTabPage::slotViewActivated() const DolphinView* newActiveView = activeViewContainer()->view(); if (newActiveView != oldActiveView) { - disconnect(oldActiveView, SIGNAL(urlChanged(KUrl)), - this, SIGNAL(activeViewUrlChanged(KUrl))); - disconnect(oldActiveView, SIGNAL(redirection(KUrl,KUrl)), - this, SLOT(slotViewUrlRedirection(KUrl,KUrl))); - connect(newActiveView, SIGNAL(urlChanged(KUrl)), - this, SIGNAL(activeViewUrlChanged(KUrl))); - connect(newActiveView, SIGNAL(redirection(KUrl,KUrl)), - this, SLOT(slotViewUrlRedirection(KUrl,KUrl))); + disconnect(oldActiveView, SIGNAL(urlChanged(QUrl)), + this, SIGNAL(activeViewUrlChanged(QUrl))); + disconnect(oldActiveView, SIGNAL(redirection(QUrl,QUrl)), + this, SLOT(slotViewUrlRedirection(QUrl,QUrl))); + connect(newActiveView, SIGNAL(urlChanged(QUrl)), + this, SIGNAL(activeViewUrlChanged(QUrl))); + connect(newActiveView, SIGNAL(redirection(QUrl,QUrl)), + this, SLOT(slotViewUrlRedirection(QUrl,QUrl))); } emit activeViewUrlChanged(activeViewContainer()->url()); emit activeViewChanged(activeViewContainer()); } -void DolphinTabPage::slotViewUrlRedirection(const KUrl& oldUrl, const KUrl& newUrl) +void DolphinTabPage::slotViewUrlRedirection(const QUrl& oldUrl, const QUrl& newUrl) { Q_UNUSED(oldUrl); emit activeViewUrlChanged(newUrl); } -DolphinViewContainer* DolphinTabPage::createViewContainer(const KUrl& url) const +DolphinViewContainer* DolphinTabPage::createViewContainer(const QUrl& url) const { DolphinViewContainer* container = new DolphinViewContainer(url, m_splitter); container->setActive(false); |
