aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/settings/qqmlsettings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/settings/qqmlsettings.cpp')
-rw-r--r--src/imports/settings/qqmlsettings.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/imports/settings/qqmlsettings.cpp b/src/imports/settings/qqmlsettings.cpp
index f73ab08cf3..011a39f20c 100644
--- a/src/imports/settings/qqmlsettings.cpp
+++ b/src/imports/settings/qqmlsettings.cpp
@@ -297,9 +297,8 @@ void QQmlSettingsPrivate::load()
const QVariant previousValue = property.read(q);
const QVariant currentValue = instance()->value(property.name(), previousValue);
- if (!currentValue.isNull()
- && currentValue.canConvert(previousValue.type())
- && previousValue != currentValue) {
+ if (!currentValue.isNull() && (!previousValue.isValid()
+ || (currentValue.canConvert(previousValue.type()) && previousValue != currentValue))) {
property.write(q, currentValue);
#ifdef SETTINGS_DEBUG
qDebug() << "QQmlSettings: load" << property.name() << "setting:" << currentValue << "default:" << previousValue;
@@ -340,9 +339,9 @@ void QQmlSettingsPrivate::_q_propertyChanged()
for (int i = offset; i < count; ++i) {
const QMetaProperty &property = mo->property(i);
changedProperties.insert(property.name(), property.read(q));
- #ifdef SETTINGS_DEBUG
+#ifdef SETTINGS_DEBUG
qDebug() << "QQmlSettings: cache" << property.name() << ":" << property.read(q);
- #endif
+#endif
}
if (timerId != 0)
q->killTimer(timerId);