Idea: SkipDirtyOnIdenticalValues WriteConfigFlag for KConfigBase / KConfig

Eduardo Robles Elvira edulix at
Fri May 23 14:00:47 BST 2008

Hello everybody!

The usual behaviour of KConfigGroup::writeEntry() (which in turns calls to 
KConfigPrivate::putData() ) is to automatically set the dirty flag. It 
doesn't matter if we're overwritting the entry with the same data.

I'm using KConfig to autosave konqueror sessions. Someone [1] has suggested 
that in order to not save power in notebooks, I shouldn't be writting to disk 
the session if it hasn't changed. The idea is to create my KConfig file with 
SkipDirtyOnIdenticalValues set as WriteConfigFlag, and the problem would be 
solved. This way others with similar needs will benefit from this change too 

I attach a proof of concept patch to see what I mean. Of course in no way 
could this be added to KDE 4.1.

        Eduardo Robles Elvira.
[1] See
"The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all progress
depends on the unreasonable man." (George Bernard Shaw)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kconfig-save-power.patch
Type: text/x-diff
Size: 1527 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the kde-core-devel mailing list