summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Uwe Broulik <kde@privat.broulik.de>2017-01-03 08:37:38 (GMT)
committerKai Uwe Broulik <kde@privat.broulik.de>2017-01-03 08:37:38 (GMT)
commit58e932c607db27bea2872625661991fb16c79d13 (patch)
tree10b2489383ec54ccb0f84715b52f75c6007b749d
parent76ac242c37b71b7dcdfaa4f78afd365b43610d6f (diff)
[Task Manager] Parent QAction to "parent" instead of this
This ensures the QAction is disposed of once the menu gets destroyed rather than accumulating forever - the methods already took a "parent" argument, which is passed the menu from QML side, for exactly that purpose. Differential Revision: https://phabricator.kde.org/D3816
-rw-r--r--applets/taskmanager/plugin/backend.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/applets/taskmanager/plugin/backend.cpp b/applets/taskmanager/plugin/backend.cpp
index 16f1f57..efbd095 100644
--- a/applets/taskmanager/plugin/backend.cpp
+++ b/applets/taskmanager/plugin/backend.cpp
@@ -142,7 +142,7 @@ QVariantList Backend::jumpListActions(const QUrl &launcherUrl, QObject *parent)
continue;
}
- QAction *action = new QAction(this);
+ QAction *action = new QAction(parent);
action->setText(name);
action->setIcon(QIcon::fromTheme(actionGroup.readEntry("Icon")));
action->setProperty("exec", exec);
@@ -204,7 +204,7 @@ QVariantList Backend::recentDocumentActions(const QUrl &launcherUrl, QObject *pa
continue;
}
- QAction *action = new QAction(this);
+ QAction *action = new QAction(parent);
action->setText(url.fileName());
action->setIcon(QIcon::fromTheme(fileItem.iconName(), QIcon::fromTheme("unknown")));
action->setProperty("agent", storageId);
@@ -219,7 +219,7 @@ QVariantList Backend::recentDocumentActions(const QUrl &launcherUrl, QObject *pa
}
if (actionCount > 0) {
- QAction *action = new QAction(this);
+ QAction *action = new QAction(parent);
action->setText(i18n("Forget Recent Documents"));
action->setProperty("agent", storageId);
connect(action, &QAction::triggered, this, &Backend::handleRecentDocumentAction);