diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-09-21 23:02:21 +0900 |
---|---|---|
committer | TDE Gitea <gitea@mirror.git.trinitydesktop.org> | 2024-09-22 09:57:21 +0000 |
commit | 8da4fdbdbc7635014f83bfa1364dfdadcb00677b (patch) | |
tree | e0eb57415c373a1dab07b2da12647e105329605a /khotkeys/kcontrol/menuedit.cpp | |
parent | 02fe8ba51a356f68b534bc470b4a29b78ba04928 (diff) | |
download | tdebase-8da4fdbdbc7635014f83bfa1364dfdadcb00677b.tar.gz tdebase-8da4fdbdbc7635014f83bfa1364dfdadcb00677b.zip |
khotkeys: make sure the kded service is controlled only by the Service Manager in TCC.
Also make sure any changes to Input Action is immediately notified to
the kded service.
This resolves issue #537.
1. Fix kded service startup settings.
In TCC --> Regional & Accessibility --> Input Actions --> General
Settings tab, there was a checkbox to "disable the daemon". This was
either quitting or relaunching khotkeys as a standalone application,
overlapping any choice set in the TCC -> TDE Components --> Service
Manager page.
khotkeys is now launched as a kded service, therefore the aforemention
checkbox is no longer required. If a user choose to manually launch
khotkeys as a standalone application, they can disable it by simply
terminating the application (either by killing it or quitting through
DCOP).
2. Notify Input Actions changes to the kded service
If Input Actions are changed, the changes will be notified to either the
kded service or the standalone khotkeys application, depending on which
of the two is running.
3. the kcm_khotkeys_init library has been removed since it is no longer
necessary.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'khotkeys/kcontrol/menuedit.cpp')
-rw-r--r-- | khotkeys/kcontrol/menuedit.cpp | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/khotkeys/kcontrol/menuedit.cpp b/khotkeys/kcontrol/menuedit.cpp index 08b8a3c22..80c632d5b 100644 --- a/khotkeys/kcontrol/menuedit.cpp +++ b/khotkeys/kcontrol/menuedit.cpp @@ -191,16 +191,34 @@ void khotkeys_send_reread_config() TQByteArray data; if( !kapp->dcopClient()->isAttached()) kapp->dcopClient()->attach(); - if( !kapp->dcopClient()->isApplicationRegistered( "khotkeys" )) + if(kapp->dcopClient()->isApplicationRegistered( "khotkeys" )) { - kdDebug( 1217 ) << "launching new khotkeys daemon" << endl; - TDEApplication::tdeinitExec( "khotkeys" ); + // khotkeys running as a standalone application + TQByteArray data; + kdDebug( 1217 ) << "telling khotkeys standalone application to reread configuration" << endl; + kapp->dcopClient()->send( "khotkeys", "khotkeys", "reread_configuration()", data ); } else { - TQByteArray data; - kapp->dcopClient()->send( "khotkeys*", "khotkeys", "reread_configuration()", data ); - kdDebug( 1217 ) << "telling khotkeys daemon to reread configuration" << endl; + TQCString replyType; + TQByteArray replyData; + if (kapp->dcopClient()->call("kded", "kded", "loadedModules()", + TQByteArray(), replyType, replyData)) + { + if (replyType == "QCStringList") + { + TQDataStream reply(replyData, IO_ReadOnly); + QCStringList modules; + reply >> modules; + if (modules.contains("khotkeys")) + { + // khotkeys running as a kded service + TQByteArray data; + kdDebug( 1217 ) << "telling khotkeys kded daemon to reread configuration" << endl; + kapp->dcopClient()->send( "kded", "khotkeys", "reread_configuration()", data ); + } + } + } } } @@ -303,7 +321,6 @@ TQString khotkeys_change_menu_entry_shortcut( const TQString& entry_P, return ""; } entry->reparent( khotkeys_get_menu_root( settings.actions )); - settings.daemon_disabled = false; // #91782 settings.write_settings(); khotkeys_send_reread_config(); return shortcut; |