diff options
author | Michele Calgaro <[email protected]> | 2024-09-19 17:48:43 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2024-09-20 22:43:03 +0900 |
commit | ba58d6adacea8a968620c708cabbce7a0857c91e (patch) | |
tree | 04220baf1d3a60482d7cf329e4cae7f51520ea50 /khotkeys/kcontrol | |
parent | 77134aead8562da8b7a58ffe58af65e5c4cafb7a (diff) | |
download | tdebase-ba58d6adacea8a968620c708cabbce7a0857c91e.tar.gz tdebase-ba58d6adacea8a968620c708cabbce7a0857c91e.zip |
Various fixes for khotkeys. This resolves issue #326.
1. ensure there is a single khotkeys instance running per session
instead of per screen (remote multihead related code)
2. allow khotkeys to be run as a kded module
3. make sure that khotkeys run either as a standalone application or as
a kded module, but not both at the same time
4. do not register khotkeys as a main DCOP entry (like an app) anymore.
When run as kded module, this was causing kded to be registered as
khotkeys a second time.
Signed-off-by: Michele Calgaro <[email protected]>
(cherry picked from commit 94368f4722fa8eae1f7e7cd4b02679a760b0d620)
Diffstat (limited to 'khotkeys/kcontrol')
-rw-r--r-- | khotkeys/kcontrol/CMakeL10n.txt | 7 | ||||
-rw-r--r-- | khotkeys/kcontrol/init.cpp | 31 |
2 files changed, 12 insertions, 26 deletions
diff --git a/khotkeys/kcontrol/CMakeL10n.txt b/khotkeys/kcontrol/CMakeL10n.txt deleted file mode 100644 index a51e4afa8..000000000 --- a/khotkeys/kcontrol/CMakeL10n.txt +++ /dev/null @@ -1,7 +0,0 @@ -##### create translation templates ############## - -tde_l10n_create_template( - CATALOG "desktop_files/khotkeys.desktop/" - SOURCES khotkeys.desktop - DESTINATION "${CMAKE_SOURCE_DIR}/translations" -) diff --git a/khotkeys/kcontrol/init.cpp b/khotkeys/kcontrol/init.cpp index 14a9c964b..62abad638 100644 --- a/khotkeys/kcontrol/init.cpp +++ b/khotkeys/kcontrol/init.cpp @@ -24,24 +24,17 @@ extern "C" { TDE_EXPORT void init_khotkeys() { - TDEConfig cfg( "khotkeysrc", true ); - cfg.setGroup( "Main" ); - if( !cfg.readBoolEntry( "Autostart", false )) - return; - // Non-xinerama multhead support in KDE is just a hack - // involving forking apps per-screen. Don't bother with - // kded modules in such case. - TQCString multiHead = getenv("TDE_MULTIHEAD"); - if (multiHead.lower() == "true") - kapp->tdeinitExec( "khotkeys" ); - else - { - DCOPRef ref( "kded", "kded" ); - if( !ref.call( "loadModule", TQCString( "khotkeys" ))) - { - kdWarning( 1217 ) << "Loading of khotkeys module failed." << endl; - kapp->tdeinitExec( "khotkeys" ); - } - } + TDEConfig cfg( "khotkeysrc", true ); + cfg.setGroup( "Main" ); + if( !cfg.readBoolEntry( "Autostart", false )) + { + return; + } + DCOPRef ref( "kded", "kded" ); + if( !ref.call( "loadModule", TQCString( "khotkeys" ))) + { + kdWarning( 1217 ) << "Loading of khotkeys module failed." << endl; + kapp->tdeinitExec( "khotkeys" ); + } } } |