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&)));
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));
}
} 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);
}