From 5b612c6620ced914c7fd239737bef2a6cb55fc50 Mon Sep 17 00:00:00 2001 From: Pan Zhang Date: Fri, 9 Jan 2026 17:31:08 +0800 Subject: 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 --- src/dolphinmainwindow.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/dolphinmainwindow.h') 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 +#include #include #include #include @@ -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 *m_sessionSaveWatcher; -- cgit v1.3