]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
Merge remote-tracking branch 'origin/KDE/4.14'
[dolphin.git] / src / dolphinmainwindow.cpp
index 0882bac71745ba6d9fdb7bcb525b8b1cc037a828..95b08af96e1d8002aea3f5e490f773d77113e270 100644 (file)
@@ -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,