diff options
| author | Luca Beltrame <[email protected]> | 2014-07-22 15:58:03 +0200 |
|---|---|---|
| committer | Luca Beltrame <[email protected]> | 2014-07-22 15:58:03 +0200 |
| commit | de3e2ae40f626c1368dfd40bace54ef3e7815833 (patch) | |
| tree | e6ff8a7225929ae1002a5756110f228845d3f35b /src/dolphinrecenttabsmenu.cpp | |
| parent | 2b75a555caa81a992a289a13119dca5cce79d4cc (diff) | |
| parent | 9a6950657215f2195001795e21785d276fb20744 (diff) | |
Merge branch 'master' into frameworks
Diffstat (limited to 'src/dolphinrecenttabsmenu.cpp')
| -rw-r--r-- | src/dolphinrecenttabsmenu.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/dolphinrecenttabsmenu.cpp b/src/dolphinrecenttabsmenu.cpp index d0b694c03..0f90e634b 100644 --- a/src/dolphinrecenttabsmenu.cpp +++ b/src/dolphinrecenttabsmenu.cpp @@ -60,7 +60,7 @@ void DolphinRecentTabsMenu::rememberClosedTab(const KUrl& primaryUrl, const KUrl } else { insertAction(menu()->actions().at(2), action); } - + emit closedTabsCountChanged(menu()->actions().size() - 2); // Assure that only up to 6 closed tabs are shown in the menu. // 8 because of clear action + separator + 6 closed tabs if (menu()->actions().size() > 8) { @@ -70,6 +70,12 @@ void DolphinRecentTabsMenu::rememberClosedTab(const KUrl& primaryUrl, const KUrl KAcceleratorManager::manage(menu()); } +void DolphinRecentTabsMenu::undoCloseTab() +{ + Q_ASSERT(menu()->actions().size() > 2); + handleAction(menu()->actions().at(2)); +} + void DolphinRecentTabsMenu::handleAction(QAction* action) { if (action == m_clearListAction) { @@ -80,14 +86,16 @@ void DolphinRecentTabsMenu::handleAction(QAction* action) for (int i = 2; i < count; ++i) { removeAction(actions.at(i)); } + emit closedTabsCountChanged(0); } else { const KUrl::List urls = action->data().value<KUrl::List>(); - if (urls.count() == 2) { - emit restoreClosedTab(urls.first(), urls.last()); - } removeAction(action); delete action; action = 0; + if (urls.count() == 2) { + emit restoreClosedTab(urls.first(), urls.last()); + } + emit closedTabsCountChanged(menu()->actions().size() - 2); } if (menu()->actions().count() <= 2) { |
