63 QSettings* settings = getSettingsObject(); |
63 QSettings* settings = getSettingsObject(); |
64 print ("config::load: Loading configuration file from %1\n", settings->fileName()); |
64 print ("config::load: Loading configuration file from %1\n", settings->fileName()); |
65 |
65 |
66 for (Config* cfg : g_configPointers) |
66 for (Config* cfg : g_configPointers) |
67 { |
67 { |
68 if (!cfg) |
68 if (not cfg) |
69 break; |
69 break; |
70 |
70 |
71 QVariant val = settings->value (cfg->name(), cfg->getDefaultAsVariant()); |
71 QVariant val = settings->value (cfg->name(), cfg->getDefaultAsVariant()); |
72 cfg->loadFromVariant (val); |
72 cfg->loadFromVariant (val); |
73 g_configsByName[cfg->name()] = cfg; |
73 g_configsByName[cfg->name()] = cfg; |
86 { |
86 { |
87 QSettings* settings = getSettingsObject(); |
87 QSettings* settings = getSettingsObject(); |
88 |
88 |
89 for (Config* cfg : g_configs) |
89 for (Config* cfg : g_configs) |
90 { |
90 { |
91 if (!cfg->isDefault()) |
91 if (not cfg->isDefault()) |
92 settings->setValue (cfg->name(), cfg->toVariant()); |
92 settings->setValue (cfg->name(), cfg->toVariant()); |
93 else |
93 else |
94 settings->remove (cfg->name()); |
94 settings->remove (cfg->name()); |
95 } |
95 } |
96 |
96 |