KConfig: Expandable flag of config entries is not persistent

Ingo Klöcker kloecker at kde.org
Sun Oct 7 21:41:28 BST 2007


Hi,

KConfigGroup seems to have a serious problem with the persistence of the 
flags of config entries. In the particular case I have encountered the 
expandable flag ($e) of a path entry is lost if the config is rewritten 
without explicitly rewritting the path entry with writePathEntry(). 
This should be a very common use case because it occurs whenever an 
application writes a path entry only if it has changed (e.g. KMail 
writes the location of the mail storage usually only a single time and 
thenceforth only reads the entry).

The attached patch for kconfigtest demonstrates the problem. After 
adding another config entry and synching the config the expandable flag 
of the path entry is gone so that the second read test of the path 
fails because readPathEntry() returns the unexpanded value $HOME/foo:

FAIL!  : KConfigTest::testPath() Compared values are not the same
   Actual (sc3.readPathEntry( "homepath", QString() )): $HOME/foo
   Expected (HOMEPATH): /home/ingo/foo
   Loc: 
[/home/ingo/svn/kde/trunk/KDE/kdelibs/kdecore/tests/kconfigtest.cpp(277)]


Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kconfigtest-test-persistence-of-expandable-flag.diff
Type: text/x-diff
Size: 852 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071007/af525b23/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071007/af525b23/attachment.sig>


More information about the kde-core-devel mailing list