X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/38381bc6a2999b1d8a0b8a6e2b8d703faa0944d9..1f02d15f7ec13dd206698f88a92a9949cbfc3470:/src/dolphinmainwindow.cpp diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 0882bac71..95b08af96 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -136,6 +136,8 @@ DolphinMainWindow::DolphinMainWindow() : this, SLOT(activeViewChanged(DolphinViewContainer*))); connect(m_tabWidget, SIGNAL(tabCountChanged(int)), this, SLOT(tabCountChanged(int))); + connect(m_tabWidget, SIGNAL(currentUrlChanged(KUrl)), + this, SLOT(setUrlAsCaption(KUrl))); setCentralWidget(m_tabWidget); setupActions(); @@ -236,7 +238,6 @@ void DolphinMainWindow::changeUrl(const KUrl& url) updatePasteAction(); updateViewActions(); updateGoActions(); - setUrlAsCaption(url); emit urlChanged(url); } @@ -945,8 +946,6 @@ void DolphinMainWindow::activeViewChanged(DolphinViewContainer* viewContainer) updateGoActions(); const KUrl url = viewContainer->url(); - setUrlAsCaption(url); - emit urlChanged(url); } @@ -958,6 +957,22 @@ void DolphinMainWindow::tabCountChanged(int count) actionCollection()->action("activate_prev_tab")->setEnabled(enableTabActions); } +void DolphinMainWindow::setUrlAsCaption(const KUrl& url) +{ + QString caption; + if (!url.isLocalFile()) { + caption.append(url.protocol() + " - "); + if (url.hasHost()) { + caption.append(url.host() + " - "); + } + } + + const QString fileName = url.fileName().isEmpty() ? "/" : url.fileName(); + caption.append(fileName); + + setCaption(caption); +} + void DolphinMainWindow::setupActions() { // setup 'File' menu @@ -1058,10 +1073,10 @@ void DolphinMainWindow::setupActions() DolphinRecentTabsMenu* recentTabsMenu = new DolphinRecentTabsMenu(this); actionCollection()->addAction("closed_tabs", recentTabsMenu); - connect(m_tabWidget, SIGNAL(rememberClosedTab(KUrl,KUrl)), - recentTabsMenu, SLOT(rememberClosedTab(KUrl,KUrl))); - connect(recentTabsMenu, SIGNAL(restoreClosedTab(KUrl,KUrl)), - this, SLOT(openNewActivatedTab(KUrl,KUrl))); + connect(m_tabWidget, SIGNAL(rememberClosedTab(KUrl,QByteArray)), + recentTabsMenu, SLOT(rememberClosedTab(KUrl,QByteArray))); + connect(recentTabsMenu, SIGNAL(restoreClosedTab(QByteArray)), + m_tabWidget, SLOT(restoreClosedTab(QByteArray))); connect(recentTabsMenu, SIGNAL(closedTabsCountChanged(uint)), this, SLOT(closedTabsCountChanged(uint))); @@ -1471,22 +1486,6 @@ bool DolphinMainWindow::isKompareInstalled() const return installed; } -void DolphinMainWindow::setUrlAsCaption(const KUrl& url) -{ - QString caption; - if (!url.isLocalFile()) { - caption.append(url.protocol() + " - "); - if (url.hasHost()) { - caption.append(url.host() + " - "); - } - } - - const QString fileName = url.fileName().isEmpty() ? "/" : url.fileName(); - caption.append(fileName); - - setCaption(caption); -} - void DolphinMainWindow::createPanelAction(const KIcon& icon, const QKeySequence& shortcut, QAction* dockAction,