kdecore: do not expand environment variables if expansion is not to be done in KConfigGroup::readPathEntry()

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-10-16 20:09:10 +03:00
parent a91b3422e3
commit ef69e4639c

View file

@ -614,7 +614,8 @@ QString KConfigGroup::readEntryUntranslated(const char *key, const QString& aDef
{
Q_ASSERT_X(isValid(), "KConfigGroup::readEntryUntranslated", "accessing an invalid group");
QString result = config()->d_func()->lookupData(d->fullName(), key, KEntryMap::SearchFlags(), 0);
bool expand = false;
QString result = config()->d_func()->lookupData(d->fullName(), key, KEntryMap::SearchFlags(), &expand);
if (result.isNull())
return aDefault;
return result;
@ -764,7 +765,10 @@ QString KConfigGroup::readPathEntry(const char *key, const QString & aDefault) c
if (aValue.isNull())
aValue = aDefault;
return KShell::envExpand(aValue);
if (expand)
return KShell::envExpand(aValue);
return aValue;
}
QStringList KConfigGroup::readPathEntry(const QString& pKey, const QStringList& aDefault) const