#6538 Added check if system config doesnt exist then copy from user settings

This commit is contained in:
Jamie Newbon 2020-04-27 16:58:27 +01:00
parent f77bc2acff
commit 62607ec390

View file

@ -446,8 +446,12 @@ void AppConfig::setLoadFromSystemScope(bool value) {
m_LoadFromSystemScope = value; m_LoadFromSystemScope = value;
m_unsavedChanges = true; m_unsavedChanges = true;
writer->globalSave(); //Save user prefs writer->globalSave(); //Save user prefs
writer->setScope(ConfigWriter::kSystem); //Switch the the System Scope and reload writer->setScope(ConfigWriter::kSystem); //Switch the the System Scope
writer->globalLoad(); //If the system scope has settings, trigger a global reload, otherwise keep the current users settings
if (writer->hasSetting(settingName(kScreenName), ConfigWriter::kUser)) {
// If the system already has settings, then load them up now.
writer->globalLoad();
}
} }
else if (!value && writer->getScope() == ConfigWriter::kSystem) else if (!value && writer->getScope() == ConfigWriter::kSystem)
{ {