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
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"));