Idea: SkipDirtyOnIdenticalValues WriteConfigFlag for KConfigBase / KConfig
Eduardo Robles Elvira
edulix at gmail.com
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.
Greetings,
Eduardo Robles Elvira.
--
[1] See http://bugs.kde.org/show_bug.cgi?id=162498#c2
--
"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: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080523/54f15beb/attachment.patch>
-------------- 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: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080523/54f15beb/attachment.sig>
More information about the kde-core-devel
mailing list