X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/0d4306596a84c04f78a8a1fc827265c307fbb2b8..abfa3fff9d899ffd5b0c2ced055f12bcf5bfa6d0:/src/dolphinmainwindow.cpp diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 7029e9bc9..aa72a2b9b 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -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); }