Commit 8d46bcb1 authored by Wescoeur's avatar Wescoeur

feat(Colors): do not override if config is null

parent 62ee52c7
...@@ -66,12 +66,15 @@ void Colors::useConfig (const shared_ptr<linphone::Config> &config) { ...@@ -66,12 +66,15 @@ void Colors::useConfig (const shared_ptr<linphone::Config> &config) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void Colors::overrideColors (const shared_ptr<linphone::Config> &config) { void Colors::overrideColors (const shared_ptr<linphone::Config> &config) {
if (!config)
return;
const QMetaObject *info = metaObject(); const QMetaObject *info = metaObject();
for (int i = info->propertyOffset(); i < info->propertyCount(); ++i) { for (int i = info->propertyOffset(); i < info->propertyCount(); ++i) {
const QMetaProperty metaProperty = info->property(i); const QMetaProperty metaProperty = info->property(i);
const string colorName = metaProperty.name(); 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()) if (!colorValue.empty())
setProperty(colorName.c_str(), QColor(::Utils::coreStringToAppString(colorValue))); setProperty(colorName.c_str(), QColor(::Utils::coreStringToAppString(colorValue)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment