diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2018-09-06 15:15:19 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-09-06 16:13:44 -0700 |
commit | e71b049498eaae05f7686445be320e90ca2f630e (patch) | |
tree | 335174bac350b3f1aaf18db58addcab619bba992 /core/settings/qPrefPrivate.cpp | |
parent | d88f86579372d356a7fd33e9fadb38a76b44c757 (diff) | |
download | subsurface-e71b049498eaae05f7686445be320e90ca2f630e.tar.gz |
qPref: only save settings that aren't the default
This brings us back to the previous behavior.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/settings/qPrefPrivate.cpp')
-rw-r--r-- | core/settings/qPrefPrivate.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/settings/qPrefPrivate.cpp b/core/settings/qPrefPrivate.cpp index ff335a94f..6e835b92f 100644 --- a/core/settings/qPrefPrivate.cpp +++ b/core/settings/qPrefPrivate.cpp @@ -9,14 +9,17 @@ void qPrefPrivate::copy_txt(const char **name, const QString &string) *name = copy_qstring(string); } -void qPrefPrivate::propSetValue(const QString &key, const QVariant &value) +void qPrefPrivate::propSetValue(const QString &key, const QVariant &value, const QVariant &defaultValue) { // REMARK: making s static (which would be logical) does NOT work // because it gets initialized too early. // Having it as a local variable is light weight, because it is an // interface class. QSettings s; - s.setValue(key, value); + if (value != defaultValue) + s.setValue(key, value); + else + s.remove(key); } QVariant qPrefPrivate::propValue(const QString &key, const QVariant &defaultValue) |