[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: KConfigGroup::entryMap ignores expand flag
From: Marijn Kruisselbrink <mkruisselbrink () kde ! org>
Date: 2011-05-09 14:52:09
Message-ID: 201105091652.09568.mkruisselbrink () kde ! org
[Download RAW message or body]
While debugging some issues I was having with KStandardDirs and configuring
paths for it in kdeglobals, I was wondering if it is by design that
KConfig/KConfigGroup::entryMap ignores the expand ($e) flag that might be set on
entries, and always returns the un-expanded values. I personally would expect
kconfigtest to still pass with the attached patch applied, but because of this
undocumented peculiarity of entryMap it doesn't. (and this also causes
problems in the KStandardDirs case where it uses entryMap to look up any dirs
that might be configured to custom paths). Should I try to fix entryMap() to als
expand values before returning them where needed, or is it intended for
entryMap to not expand values?
Marijn
["kconfigentrymapexpandedtest.patch" (text/x-patch)]
diff --git a/kdecore/tests/kconfigtest.cpp b/kdecore/tests/kconfigtest.cpp
index ce5a0db..85db2d2 100644
--- a/kdecore/tests/kconfigtest.cpp
+++ b/kdecore/tests/kconfigtest.cpp
@@ -438,6 +438,7 @@ void KConfigTest::testPath()
KConfigGroup sc3(&sc2, "Path Type");
QCOMPARE( sc3.readPathEntry( "homepath", QString() ), HOMEPATH );
QCOMPARE( sc3.readPathEntry( "homepathescape", QString() ), HOMEPATHESCAPE );
+ QCOMPARE( sc3.entryMap()["homePath"], HOMEPATH );
{
QFile file(KStandardDirs::locateLocal("config", "pathtest"));
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic