aboutsummaryrefslogtreecommitdiff
path: root/src/core/kconfigdata.cpp
diff options
context:
space:
mode:
authorBenjamin Port <benjamin.port@enioka.com>2020-03-17 15:13:11 +0100
committerBenjamin Port <benjamin.port@enioka.com>2020-04-17 14:48:42 +0200
commitbe28e096c5337b61a5e2f6e048ea297b2cc4b916 (patch)
treef3aac7a7d8ed5b8e90f65a86f44bb2e7e5e8057b /src/core/kconfigdata.cpp
parent65cc12ab3ec8ca313d0e9d9b6d506e9fa9042bc1 (diff)
downloadkconfig-be28e096c5337b61a5e2f6e048ea297b2cc4b916.tar.gz
kconfig-be28e096c5337b61a5e2f6e048ea297b2cc4b916.tar.bz2
Add force save behavior to KEntryMap
Summary: Fix the following bug, if an entry is set on HOME/.config/kdeglobals and on a specific config file like kcmfonts When you hit restore defaults button and apply, value will be not wrote on the specific file, but then the value is the one from kdeglobals This patch ensure we write the key to the specific configuration file on those case with an empty value. KConfig will take default value automatically Test Plan: Added a test to ensure flag is working Tested using some KCM to ensure all is working fine Reviewers: ervin, dfaure, meven, crossi, hchain Reviewed By: ervin, dfaure, meven Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D28128
Diffstat (limited to 'src/core/kconfigdata.cpp')
-rw-r--r--src/core/kconfigdata.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/kconfigdata.cpp b/src/core/kconfigdata.cpp
index bfa662a0..5ead8167 100644
--- a/src/core/kconfigdata.cpp
+++ b/src/core/kconfigdata.cpp
@@ -100,6 +100,10 @@ bool KEntryMap::setEntry(const QByteArray &group, const QByteArray &key, const Q
k = it.key();
e = *it;
//qDebug() << "found existing entry for key" << k;
+ // If overridden entry is global and not default. And it's overridden by a non global
+ if (e.bGlobal && !(options & EntryGlobal) && !k.bDefault) {
+ e.bOverridesGlobal = true;
+ }
} else {
// make sure the group marker is in the map
KEntryMap const *that = this;