From 30299e00b137fb5abf31e6f82fc8f4753f9a929a Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Sun, 18 Apr 2021 08:37:45 +0200 Subject: Reuse KFileItemActions instance during lifetime of dolphin With https://invent.kde.org/frameworks/kio/-/merge_requests/411 the plugin instances can be reused during the lifetime of the KFileItemActions object. This improves performance and also allows the plugins to emit errors, even if they run async. --- src/dolphincontextmenu.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/dolphincontextmenu.h') diff --git a/src/dolphincontextmenu.h b/src/dolphincontextmenu.h index afd8b8c4d..e033fca6e 100644 --- a/src/dolphincontextmenu.h +++ b/src/dolphincontextmenu.h @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -57,7 +58,8 @@ public: DolphinContextMenu(DolphinMainWindow* parent, const QPoint& pos, const KFileItem& fileInfo, - const QUrl& baseUrl); + const QUrl& baseUrl, + KFileItemActions *fileItemActions); ~DolphinContextMenu() override; @@ -104,7 +106,7 @@ private: /** * Adds "Open With" actions */ - void addOpenWithActions(KFileItemActions& fileItemActions); + void addOpenWithActions(); /** * Adds custom actions e.g. like the "[x] Expandable Folders"-action @@ -116,7 +118,7 @@ private: /** * Add services, custom actions, plugins and version control items to the menu */ - void addAdditionalActions(KFileItemActions &fileItemActions, const KFileItemListProperties &props); + void addAdditionalActions(const KFileItemListProperties &props); struct Entry { @@ -155,7 +157,8 @@ private: Command m_command; DolphinRemoveAction* m_removeAction; // Action that represents either 'Move To Trash' or 'Delete' - void addDirectoryItemContextMenu(KFileItemActions &fileItemActions); + void addDirectoryItemContextMenu(); + KFileItemActions *m_fileItemActions; }; -- cgit v1.3