You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/kde-plasma/plasma-desktop/files/plasma-desktop-5.8.5-taskma...

44 lines
1.9 KiB

commit 58e932c607db27bea2872625661991fb16c79d13
Author: Kai Uwe Broulik <kde@privat.broulik.de>
Date: Tue Jan 3 09:37:38 2017 +0100
[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
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);