mirror of
https://invent.kde.org/plasma/plasma-desktop.git
synced 2026-11-03 14:49:44 -09:00
foldermodel: give KFileItemActions a QObject to own plugin-returned actions
There is no QWidget to use as parentWidget on this QML path, so plugins that need an owner for the QActions they return (such as Dolphin's folder icon action via KFileItemActionPluginV2) got nullptr and leaked them. Pass the popup menu through KFileItemActions::setParentObject(), added in KIO 6.32 (https://invent.kde.org/frameworks/kio/-/merge_requests/2427). The menu is deleted right after the popup closes, which also frees the actions. It is not set as parentWidget, since that is also used for job dialogs that must outlive the popup. CCBUG: 525162
This commit is contained in:
parent
bed7916645
commit
cb94120457
1 changed files with 2 additions and 0 deletions
|
|
@ -2032,6 +2032,8 @@ void FolderModel::openContextMenu(QQuickItem *visualParent, Qt::KeyboardModifier
|
|||
if (!m_fileItemActions) {
|
||||
m_fileItemActions = new KFileItemActions(this);
|
||||
}
|
||||
// Let `menu` own the QActions plugins return, so they go away with the popup (see aboutToHide below).
|
||||
m_fileItemActions->setParentObject(menu);
|
||||
|
||||
if (indexes.isEmpty()) {
|
||||
menu->addAction(m_actionCollection.action(QStringLiteral("newMenu")));
|
||||
|
|
|
|||
Loading…
Reference in a new issue