ktoolbar and index value

Benjamin Meyer ben at meyerhome.net
Mon Jul 19 00:17:08 BST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I found that many of the config files in my cvs head account for apps 
contained a lone entry for index=0.  Taking a look at the code I agree with 
the comment above the patch (in ktoolbar.cpp) that states that the initial 
value (-1) will never be the same at the stored default value (0).  So I 
added a check for 0.  I played around with this on apps with one toolbar and 
a number of toolbars and from the testing it works, but I don't know 
everywhere that index is utilized.  Can someone with more experience with 
ktoolbar and the index value tell me if this is good or wont work?

- -Benjamin Meyer

Index: ktoolbar.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/ktoolbar.cpp,v
retrieving revision 1.383
diff -u -3 -p -r1.383 ktoolbar.cpp
- --- ktoolbar.cpp        9 Jul 2004 09:40:15 -0000       1.383
+++ ktoolbar.cpp        18 Jul 2004 23:03:17 -0000
@@ -1095,7 +1095,10 @@ void KToolBar::saveSettings(KConfig *con
     // reappear at the same position the next time.
     // The whole set of indexes has to be saved.
     //kdDebug(220) << name() << "                writing index " << index << 
endl;
- -    config->writeEntry("Index", index);
+     if(!config->hasDefault("Index") && index == 0 )
+      config->revertToDefault("Index");
+    else
+      config->writeEntry("Index", index);

     if(!config->hasDefault("Offset") && offset() == d->OffsetDefault )
       config->revertToDefault("Offset");

- -- 
aka icefox
Public Key: http://www.csh.rit.edu/~benjamin/public_key.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA+wT01rZ3LTw38vIRAt95AJ9JxbTs4vnBWoWt4aMaJ3nyPOovhACgs8EI
H/FeRPmde2GV4Jz8b1ES8nU=
=J+G8
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list