From 8d46bcb1ae968099a56f3aff665229082dc51d0b Mon Sep 17 00:00:00 2001 From: Wescoeur Date: Sun, 16 Jul 2017 22:22:11 +0200 Subject: [PATCH] feat(Colors): do not override if config is null --- src/components/other/colors/Colors.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/other/colors/Colors.cpp b/src/components/other/colors/Colors.cpp index 11cb24b75..2fd4a1c13 100644 --- a/src/components/other/colors/Colors.cpp +++ b/src/components/other/colors/Colors.cpp @@ -66,12 +66,15 @@ void Colors::useConfig (const shared_ptr &config) { // ----------------------------------------------------------------------------- void Colors::overrideColors (const shared_ptr &config) { + if (!config) + return; + const QMetaObject *info = metaObject(); for (int i = info->propertyOffset(); i < info->propertyCount(); ++i) { const QMetaProperty metaProperty = info->property(i); const string colorName = metaProperty.name(); - const string colorValue = config ? config->getString(COLORS_SECTION, colorName, "") : ""; + const string colorValue = config->getString(COLORS_SECTION, colorName, ""); if (!colorValue.empty()) setProperty(colorName.c_str(), QColor(::Utils::coreStringToAppString(colorValue)));