]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinrecenttabsmenu.cpp
Merge branch 'master' into kf6
[dolphin.git] / src / dolphinrecenttabsmenu.cpp
index adc6a8edadec339c933d46acfaad0caa076693c8..6a647c1774e428df48274ff25ea0f5611acd1278 100644 (file)
@@ -12,8 +12,8 @@
 
 #include <QMenu>
 
-DolphinRecentTabsMenu::DolphinRecentTabsMenu(QObject* parent) :
-    KActionMenu(QIcon::fromTheme(QStringLiteral("edit-undo")), i18n("Recently Closed Tabs"), parent)
+DolphinRecentTabsMenu::DolphinRecentTabsMenu(QObject *parent)
+    KActionMenu(QIcon::fromTheme(QStringLiteral("edit-undo")), i18n("Recently Closed Tabs"), parent)
 {
     setPopupMode(QToolButton::InstantPopup);
     setEnabled(false);
@@ -24,13 +24,12 @@ DolphinRecentTabsMenu::DolphinRecentTabsMenu(QObject* parent) :
 
     addSeparator();
 
-    connect(menu(), &QMenu::triggered,
-            this, &DolphinRecentTabsMenu::handleAction);
+    connect(menu(), &QMenu::triggered, this, &DolphinRecentTabsMenu::handleAction);
 }
 
-void DolphinRecentTabsMenu::rememberClosedTab(const QUrl& url, const QByteArray& state)
+void DolphinRecentTabsMenu::rememberClosedTab(const QUrl &url, const QByteArray &state)
 {
-    QActionaction = new QAction(menu());
+    QAction *action = new QAction(menu());
     action->setText(url.path());
     action->setData(state);
     const QString iconName = KIO::iconNameForUrl(url);
@@ -59,12 +58,12 @@ void DolphinRecentTabsMenu::undoCloseTab()
     handleAction(menu()->actions().at(2));
 }
 
-void DolphinRecentTabsMenu::handleAction(QActionaction)
+void DolphinRecentTabsMenu::handleAction(QAction *action)
 {
     if (action == m_clearListAction) {
         // Clear all actions except the "Empty Recently Closed Tabs"
         // action and the separator
-        QList<QAction*> actions = menu()->actions();
+        QList<QAction *> actions = menu()->actions();
         const int count = actions.size();
         for (int i = count - 1; i >= 2; i--) {
             removeAction(actions.at(i));
@@ -83,3 +82,5 @@ void DolphinRecentTabsMenu::handleAction(QAction* action)
         setEnabled(false);
     }
 }
+
+#include "moc_dolphinrecenttabsmenu.cpp"