mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-31 02:49:21 +00:00
feat(Colors): do not override if config is null
This commit is contained in:
parent
62ee52c754
commit
8d46bcb1ae
1 changed files with 4 additions and 1 deletions
|
|
@ -66,12 +66,15 @@ void Colors::useConfig (const shared_ptr<linphone::Config> &config) {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void Colors::overrideColors (const shared_ptr<linphone::Config> &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)));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue