diff options
| author | Alexander Lohnau <[email protected]> | 2021-04-18 08:37:45 +0200 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2021-07-04 20:33:48 +0000 |
| commit | 30299e00b137fb5abf31e6f82fc8f4753f9a929a (patch) | |
| tree | c6d28ce3e7da2c8f9da410b65386e52d3232382e /src/dolphincontextmenu.h | |
| parent | dd7f3fb783a2164e282d88140f301bf8c0af9e5b (diff) | |
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.
Diffstat (limited to 'src/dolphincontextmenu.h')
| -rw-r--r-- | src/dolphincontextmenu.h | 11 |
1 files changed, 7 insertions, 4 deletions
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 <KFileCopyToMenu> #include <KFileItem> +#include <KFileItemActions> #include <QMenu> #include <QUrl> @@ -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; }; |
