From ed28682265bd95416a98d5ccc6a72e96563f84f3 Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 23 Jun 2021 12:05:33 +0200 Subject: KConfig: fix deletion of an entry that is also in kdeglobals This is the case where we expected to see Key[$d] in the config file, and it was somehow broken. When saving, the key was omitted, so when reloading the kdeglobals key was present again. Detected when trying to write a unittest for a different patch... I had to reshuffle the unittest a bit because testThreads calls testSimple which didn't expect that the "[AAA]" group would actually be deleted now. --- src/core/kconfigini.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/kconfigini.cpp') diff --git a/src/core/kconfigini.cpp b/src/core/kconfigini.cpp index a67e490f..2792cb4f 100644 --- a/src/core/kconfigini.cpp +++ b/src/core/kconfigini.cpp @@ -437,7 +437,7 @@ bool KConfigIniBackend::writeConfig(const QByteArray &locale, KEntryMap &entryMa } else { KEntryKey defaultKey = key; defaultKey.bDefault = true; - if (!entryMap.contains(defaultKey)) { + if (!entryMap.contains(defaultKey) && !it->bOverridesGlobal) { writeMap.remove(key); // remove the deleted entry if there is no default // qDebug() << "Detected as deleted=>removed:" << key.mGroup << key.mKey << "global=" << bGlobal; } else { -- cgit v1.2.1