summaryrefslogtreecommitdiffstats
path: root/khotkeys/kcontrol/kcmkhotkeys.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2024-09-21 23:02:21 +0900
committerTDE Gitea <[email protected]>2024-09-22 09:57:21 +0000
commit8da4fdbdbc7635014f83bfa1364dfdadcb00677b (patch)
treee0eb57415c373a1dab07b2da12647e105329605a /khotkeys/kcontrol/kcmkhotkeys.cpp
parent02fe8ba51a356f68b534bc470b4a29b78ba04928 (diff)
downloadtdebase-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 <[email protected]>
Diffstat (limited to 'khotkeys/kcontrol/kcmkhotkeys.cpp')
-rw-r--r--khotkeys/kcontrol/kcmkhotkeys.cpp33
1 files changed, 21 insertions, 12 deletions
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 );