X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/d9d7926c49c097fd1f5b72576e2c84c3989e89e7..b7ad5fb99d32d43fe4e083a8ffc2ebfbd046d2db:/src/dolphintabpage.cpp diff --git a/src/dolphintabpage.cpp b/src/dolphintabpage.cpp index 2d02ff049..0382341c8 100644 --- a/src/dolphintabpage.cpp +++ b/src/dolphintabpage.cpp @@ -40,10 +40,10 @@ DolphinTabPage::DolphinTabPage(const QUrl &primaryUrl, const QUrl &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(), &DolphinView::urlChanged, + this, &DolphinTabPage::activeViewUrlChanged); + connect(m_primaryViewContainer->view(), &DolphinView::redirection, + this, &DolphinTabPage::slotViewUrlRedirection); m_splitter->addWidget(m_primaryViewContainer); m_primaryViewContainer->show(); @@ -52,7 +52,7 @@ DolphinTabPage::DolphinTabPage(const QUrl &primaryUrl, const QUrl &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(); @@ -77,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(); @@ -213,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; @@ -222,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; @@ -257,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; @@ -265,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; @@ -302,35 +302,35 @@ 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, &DolphinView::urlChanged, + this, &DolphinTabPage::activeViewUrlChanged); + disconnect(oldActiveView, &DolphinView::redirection, + this, &DolphinTabPage::slotViewUrlRedirection); + connect(newActiveView, &DolphinView::urlChanged, + this, &DolphinTabPage::activeViewUrlChanged); + connect(newActiveView, &DolphinView::redirection, + this, &DolphinTabPage::slotViewUrlRedirection); } 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); const DolphinView* view = container->view(); - connect(view, SIGNAL(activated()), - this, SLOT(slotViewActivated())); + connect(view, &DolphinView::activated, + this, &DolphinTabPage::slotViewActivated); return container; }