]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
The "Recently Closed Tabs" action menu now has a limit of 10, before it could just...
[dolphin.git] / src / dolphinmainwindow.cpp
index 7029e9bc95d37f7ddf2343880a9cbeb59d3a4d12..aa72a2b9b6dd6798aed070940af39d25362cf333 100644 (file)
@@ -923,7 +923,7 @@ void DolphinMainWindow::init()
     m_tabBar->setTabsClosable(true);
     connect(m_tabBar, SIGNAL(currentChanged(int)),
             this, SLOT(setActiveTab(int)));
-    connect(m_tabBar, SIGNAL(closeRequest(int)),
+    connect(m_tabBar, SIGNAL(tabCloseRequested(int)),
             this, SLOT(closeTab(int)));
     connect(m_tabBar, SIGNAL(contextMenu(int, const QPoint&)),
             this, SLOT(openTabContextMenu(int, const QPoint&)));
@@ -1006,7 +1006,7 @@ void DolphinMainWindow::setActiveViewContainer(DolphinViewContainer* viewContain
 
     const KUrl& url = m_activeViewContainer->url();
     setCaption(url.fileName());
-    if (m_viewTab.count() > 1) {
+    if (m_viewTab.count() > 1 && m_viewTab[m_tabIndex].secondaryView != 0) {
         m_tabBar->setTabText(m_tabIndex, tabName(url));
     }
 
@@ -1348,6 +1348,11 @@ void DolphinMainWindow::rememberClosedTab(int index)
     } else {
         tabsMenu->insertAction(tabsMenu->actions().at(2), action);
     }
+    //10 is the limit, remove the oldest one to make room. It's actually 8, since
+    //the separator and the "Empty Recently Closed Tabs" entry count as one
+    if (tabsMenu->actions().size() > 8) {
+        tabsMenu->removeAction(tabsMenu->actions().last());
+    }
     actionCollection()->action("closed_tabs")->setEnabled(true);
 }