MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / changeSetting

Method changeSetting

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

Source from the content-addressed store, hash-verified

48}
49
50void INISettingsObject::changeSetting(const Setting &setting, QVariant value)
51{
52 if (contains(setting.id()))
53 {
54 // valid value -> set the main config, remove all the sysnonyms
55 if (value.isValid())
56 {
57 auto list = setting.configKeys();
58 m_ini.set(list.takeFirst(), value);
59 for(auto iter: list)
60 m_ini.remove(iter);
61 }
62 // invalid -> remove all (just like resetSetting)
63 else
64 {
65 for(auto iter: setting.configKeys())
66 m_ini.remove(iter);
67 }
68 doSave();
69 }
70}
71
72void INISettingsObject::doSave()
73{

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