[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/kcontrol/keys
From:       Luboš Luňák <l.lunak () kde ! org>
Date:       2004-09-07 14:45:30
Message-ID: 20040907144530.5779790E7 () office ! kde ! org
[Download RAW message or body]

CVS commit by lunakl: 

init_keys is one of the longest taking kcminit modules -> don't write
the global shortcuts settings to kdeglobals at every KDE startup,
only if the default keys have possibly changed.
In fact this shouldn't be written to kdeglobals at all, but some other
config file, but that'd mean trying luck with the KShortcuts stuff.
Will try later :-/.


  M +18 -13    main.cpp   1.58


--- kdebase/kcontrol/keys/main.cpp  #1.57:1.58
@@ -146,7 +146,4 @@ extern "C"
   }
 
-  // write all the global keys to kdeglobals
-  // this is needed to be able to check for conflicts with global keys in app's keyconfig
-  // dialogs, kdeglobals is empty as long as you don't apply any change in controlcenter/keys
   void init_keys()
   {
@@ -176,4 +173,10 @@ extern "C"
 #include "../../kxkb/kxkbbindings.cpp"
 
+  // Write all the global keys to kdeglobals.
+  // This is needed to be able to check for conflicts with global keys in app's keyconfig
+  // dialogs, kdeglobals is empty as long as you don't apply any change in controlcenter/keys.
+  // However, avoid writing at every KDE startup, just update them after every rebuild of this file.
+        KConfigGroup group( KGlobal::config(), "Global Shortcuts" );
+        if( group.readEntry( "Defaults timestamp" ) != __DATE__ __TIME__ ) {
         kdDebug(125) << "KeyModule::init() - Read Config Bindings\n";
         // Check for old group,
@@ -187,6 +190,8 @@ extern "C"
         kdDebug(125) << "KeyModule::init() - Write Config Bindings\n";
         keys->writeActions( "Global Shortcuts", 0, true, true );
-
+            group.writeEntry( "Defaults timestamp", __DATE__ __TIME__, true, true );
+        }
         delete keys;
+
         initModifiers();
   }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic