summaryrefslogtreecommitdiffstats
path: root/core/settings
diff options
context:
space:
mode:
Diffstat (limited to 'core/settings')
-rw-r--r--core/settings/qPrefPrivate.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/core/settings/qPrefPrivate.cpp b/core/settings/qPrefPrivate.cpp
index 8cbbe932e..14fb1be1e 100644
--- a/core/settings/qPrefPrivate.cpp
+++ b/core/settings/qPrefPrivate.cpp
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#include "qPrefPrivate.h"
+#include "core/subsurface-string.h"
#include <QSettings>
@@ -22,7 +23,13 @@ void qPrefPrivate::propSetValue(const QString &key, const QVariant &value, const
// Having it as a local variable is light weight, because it is an
// interface class.
QSettings s;
- if (value != defaultValue)
+ bool isDefault = false;
+ if (value.isValid() && value.type() == QVariant::Double)
+ isDefault = IS_FP_SAME(value.toDouble(), defaultValue.toDouble());
+ else
+ isDefault = (value == defaultValue);
+
+ if (!isDefault)
s.setValue(key, value);
else
s.remove(key);