MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / changeSetting

Method changeSetting

launcher/settings/INISettingsObject.cpp:70–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70void INISettingsObject::changeSetting(const Setting& setting, QVariant value)
71{
72 if (contains(setting.id())) {
73 // valid value -> set the main config, remove all the sysnonyms
74 if (value.isValid()) {
75 auto list = setting.configKeys();
76 m_ini.set(list.takeFirst(), value);
77 for (auto iter : list)
78 m_ini.remove(iter);
79 }
80 // invalid -> remove all (just like resetSetting)
81 else {
82 for (auto iter : setting.configKeys())
83 m_ini.remove(iter);
84 }
85 doSave();
86 }
87}
88
89void INISettingsObject::doSave()
90{

Callers

nothing calls this directly

Calls 5

configKeysMethod · 0.80
idMethod · 0.45
isValidMethod · 0.45
setMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected