[PATCH] Fix for KConfigBase::readListEntry

Ingo Klöcker kloecker at kde.org
Sat Oct 19 20:59:04 BST 2002


Hi,

while trying to fix Bug #49301 
(http://bugs.kde.org/show_bug.cgi?id=49301) I noticed that 
KConfigBase::readListEntry doesn't read the saved string list correctly 
when the last entry in the list ends in "\\," where ',' is the 
separator.

Example code:
  KConfigGroup temp(kapp->config(), "aaaTemp");
  temp.writeEntry("QStringList", QStringList() << 
"10028399918.107728_1.machine1-12a:2," );

writes:
[aaaTemp]
QStringList=10028399918.107728_1.machine1-12a:2\\,

But
  KConfigGroup temp(kapp->config(), "aaaTemp");
  QStringList aaatemp = temp.readListEntry("QStringList");
  kdDebug(5006) << "QStringList has " << aaatemp.count() << " entries" 
<< endl;

prints:
QStringList has 0 entries

The attached patch fixes this bug. Ok to commit?

Regards,
Ingo

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_KConfigBase::readListEntry.diff
Type: text/x-diff
Size: 826 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20021019/6aaaeac1/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20021019/6aaaeac1/attachment.sig>


More information about the kde-core-devel mailing list