┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinrecenttabsmenu.cpp
diff options
context:
space:
mode:
authorEmmanuel Pescosta <[email protected]>2014-08-10 20:36:44 +0200
committerEmmanuel Pescosta <[email protected]>2014-08-13 20:50:36 +0200
commit62418c58a58fac668e713655552b1c614b226298 (patch)
tree33997f4913c95c8a6dd2bd10a1cf3acb02439eee /src/dolphinrecenttabsmenu.cpp
parent4b70446c17dff6646c11966670bcbe145d07c685 (diff)
Use DolphinTabPage saveState/restoreState to remember and re-open closed tabs.
REVIEW: 118968
Diffstat (limited to 'src/dolphinrecenttabsmenu.cpp')
-rw-r--r--src/dolphinrecenttabsmenu.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/dolphinrecenttabsmenu.cpp b/src/dolphinrecenttabsmenu.cpp
index 2335f1bf4..fa3eaf166 100644
--- a/src/dolphinrecenttabsmenu.cpp
+++ b/src/dolphinrecenttabsmenu.cpp
@@ -40,19 +40,14 @@ DolphinRecentTabsMenu::DolphinRecentTabsMenu(QObject* parent) :
this, SLOT(handleAction(QAction*)));
}
-void DolphinRecentTabsMenu::rememberClosedTab(const KUrl& primaryUrl, const KUrl& secondaryUrl)
+void DolphinRecentTabsMenu::rememberClosedTab(const KUrl& url, const QByteArray& state)
{
QAction* action = new QAction(menu());
- action->setText(primaryUrl.path());
-
- const QString iconName = KMimeType::iconNameForUrl(primaryUrl);
+ action->setText(url.path());
+ action->setData(state);
+ const QString iconName = KMimeType::iconNameForUrl(url);
action->setIcon(KIcon(iconName));
- KUrl::List urls;
- urls << primaryUrl;
- urls << secondaryUrl;
- action->setData(QVariant::fromValue(urls));
-
// Add the closed tab menu entry after the separator and
// "Empty Recently Closed Tabs" entry
if (menu()->actions().size() == 2) {
@@ -88,13 +83,11 @@ void DolphinRecentTabsMenu::handleAction(QAction* action)
}
emit closedTabsCountChanged(0);
} else {
- const KUrl::List urls = action->data().value<KUrl::List>();
+ const QByteArray state = action->data().value<QByteArray>();
removeAction(action);
delete action;
action = 0;
- if (urls.count() == 2) {
- emit restoreClosedTab(urls.first(), urls.last());
- }
+ emit restoreClosedTab(state);
emit closedTabsCountChanged(menu()->actions().size() - 2);
}