From 52ce9af3757a003f59d59b0c54da825da72c2b3b Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 13 May 2015 17:53:18 -0700 Subject: [PATCH] fix updateSetting conditionals after merge --- domain-server/src/DomainServerSettingsManager.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/domain-server/src/DomainServerSettingsManager.cpp b/domain-server/src/DomainServerSettingsManager.cpp index 116cbc7656..fd356da985 100644 --- a/domain-server/src/DomainServerSettingsManager.cpp +++ b/domain-server/src/DomainServerSettingsManager.cpp @@ -277,8 +277,6 @@ void DomainServerSettingsManager::updateSetting(const QString& key, const QJsonV sanitizedValue.prepend('/'); } - qDebug() << "Setting" << key << "in" << settingMap << "to" << sanitizedValue; - settingMap[key] = sanitizedValue; } } @@ -328,11 +326,15 @@ void DomainServerSettingsManager::updateSetting(const QString& key, const QJsonV updateSetting(sanitizedKey, newValue.toObject()[childKey], thisMap, childDescriptionObject); } - } - if (settingMap[key].toMap().isEmpty()) { - // we've cleared all of the settings below this value, so remove this one too - settingMap.remove(key); + if (settingMap[key].toMap().isEmpty()) { + // we've cleared all of the settings below this value, so remove this one too + settingMap.remove(key); + } + } else if (newValue.isArray()) { + // we just assume array is replacement + // TODO: we still need to recurse here with the description in case values in the array have special types + settingMap[key] = newValue.toArray().toVariantList(); } }