From 8da4fdbdbc7635014f83bfa1364dfdadcb00677b Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 21 Sep 2024 23:02:21 +0900 Subject: 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 --- khotkeys/kcontrol/kcmkhotkeys.cpp | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'khotkeys/kcontrol/kcmkhotkeys.cpp') diff --git a/khotkeys/kcontrol/kcmkhotkeys.cpp b/khotkeys/kcontrol/kcmkhotkeys.cpp index b63416eeb..406a29e35 100644 --- a/khotkeys/kcontrol/kcmkhotkeys.cpp +++ b/khotkeys/kcontrol/kcmkhotkeys.cpp @@ -122,24 +122,33 @@ void Module::save() tab_widget->save_current_action_changes(); settings.actions = _actions_root; settings.write_settings(); - if( daemon_disabled()) + if(kapp->dcopClient()->isApplicationRegistered( "khotkeys" )) { + // khotkeys running as a standalone application TQByteArray data; - kapp->dcopClient()->send( "khotkeys*", "khotkeys", "quit()", data ); - kdDebug( 1217 ) << "disabling khotkeys daemon" << endl; + kdDebug( 1217 ) << "telling khotkeys standalone application to reread configuration" << endl; + kapp->dcopClient()->send( "khotkeys", "khotkeys", "reread_configuration()", data ); } else { - if( !kapp->dcopClient()->isApplicationRegistered( "khotkeys" )) + TQCString replyType; + TQByteArray replyData; + if (kapp->dcopClient()->call("kded", "kded", "loadedModules()", + TQByteArray(), replyType, replyData)) { - kdDebug( 1217 ) << "launching new khotkeys daemon" << endl; - TDEApplication::tdeinitExec( "khotkeys" ); - } - else - { - TQByteArray data; - kapp->dcopClient()->send( "khotkeys*", "khotkeys", "reread_configuration()", data ); - kdDebug( 1217 ) << "telling khotkeys daemon to reread configuration" << endl; + 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 ); + } + } } } emit TDECModule::changed( false ); -- cgit v1.2.1