diff options
| author | Pan Zhang <[email protected]> | 2026-01-09 17:31:08 +0800 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2026-01-09 14:11:35 +0000 |
| commit | 5b612c6620ced914c7fd239737bef2a6cb55fc50 (patch) | |
| tree | 89f0504d8cc4c49f4266d58ff71d072360627a94 /src/dolphinmainwindow.h | |
| parent | 6a6a9cd363271d632b5b546804473e5cd807bb40 (diff) | |
dolphinmainwindow: Reload context menu plugins when configuration changes
Reload the context menu plugins and share the KFileItemActions with the context menu so it stays up-to-date as the user changes the service menu settings.
This uses a KConfigWatcher to trigger settings reload on "kservicemenurc" changes, covering both internal settings changes and external scripts.
Remove the obsolete restart prompt in ContextMenuSettingsPage since changes are now applied instantly.
BUG: 508722
Diffstat (limited to 'src/dolphinmainwindow.h')
| -rw-r--r-- | src/dolphinmainwindow.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index 2c8d444ad..a05fa1227 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -14,6 +14,7 @@ #include "dolphintabwidget.h" #include "selectionmode/bottombar.h" #include <KActionMenu> +#include <KConfigWatcher> #include <KFileItemActions> #include <kio/fileundomanager.h> #include <kxmlguiwindow.h> @@ -694,6 +695,11 @@ private: */ void setupDockWidgets(); + /** + * Initializes or re-initializes the KFileItemActions instance. + */ + void setupFileItemActions(); + void updateFileAndEditActions(); void updateViewActions(); void updateGoActions(); @@ -790,7 +796,8 @@ private: DiskSpaceUsageMenu *m_diskSpaceUsageMenu; QMenu m_searchTools; - KFileItemActions m_fileItemActions; + KConfigWatcher::Ptr m_serviceMenuConfigWatcher; + KFileItemActions *m_fileItemActions = nullptr; QTimer *m_sessionSaveTimer; QFutureWatcher<void> *m_sessionSaveWatcher; |
