]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinrecenttabsmenu.cpp
Merge branch 'master' of git.kde.org:dolphin
[dolphin.git] / src / dolphinrecenttabsmenu.cpp
index 5440a1b37823a4f6c0f45f8a07a10c1699cb39a8..c155632c6707c8f68593466bcc3606a1166f1552 100644 (file)
 #include <KLocalizedString>
 #include <KAcceleratorManager>
 #include <kio/global.h>
-#include <KMenu>
+#include <QMenu>
 
 DolphinRecentTabsMenu::DolphinRecentTabsMenu(QObject* parent) :
-    KActionMenu(QIcon::fromTheme("edit-undo"), i18n("Recently Closed Tabs"), parent)
+    KActionMenu(QIcon::fromTheme(QStringLiteral("edit-undo")), i18n("Recently Closed Tabs"), parent)
 {
     setDelayed(false);
     setEnabled(false);
 
     m_clearListAction = new QAction(i18n("Empty Recently Closed Tabs"), this);
-    m_clearListAction->setIcon(QIcon::fromTheme("edit-clear-list"));
+    m_clearListAction->setIcon(QIcon::fromTheme(QStringLiteral("edit-clear-list")));
     addAction(m_clearListAction);
 
     addSeparator();
 
-    connect(menu(), SIGNAL(triggered(QAction*)),
-            this, SLOT(handleAction(QAction*)));
+    connect(menu(), &QMenu::triggered,
+            this, &DolphinRecentTabsMenu::handleAction);
 }
 
-void DolphinRecentTabsMenu::rememberClosedTab(const KUrl& url, const QByteArray& state)
+void DolphinRecentTabsMenu::rememberClosedTab(const QUrl& url, const QByteArray& state)
 {
     QAction* action = new QAction(menu());
     action->setText(url.path());
@@ -83,7 +83,7 @@ void DolphinRecentTabsMenu::handleAction(QAction* action)
         }
         emit closedTabsCountChanged(0);
     } else {
-        const QByteArray state = action->data().value<QByteArray>();
+        const QByteArray state = action->data().toByteArray();
         removeAction(action);
         delete action;
         action = 0;
@@ -94,4 +94,4 @@ void DolphinRecentTabsMenu::handleAction(QAction* action)
     if (menu()->actions().count() <= 2) {
         setEnabled(false);
     }
-}
\ No newline at end of file
+}