+void Settings::overrideDefaults(Settings *other)
+{
+ for (const auto &setting : other->m_settings) {
+ if (setting.second.is_group) {
+ setGroupDefault(setting.first, setting.second.group);
+ continue;
+ }
+ const FlagDesc *flagdesc = getFlagDescFallback(setting.first);
+ if (flagdesc) {
+ // Flags cannot be copied directly.
+ // 1) Get the current set flags
+ u32 flags = getFlagStr(setting.first, flagdesc, nullptr);
+ // 2) Set the flags as defaults
+ other->setDefault(setting.first, flagdesc, flags);
+ // 3) Get the newly set flags and override the default setting value
+ setDefault(setting.first, flagdesc,
+ other->getFlagStr(setting.first, flagdesc, nullptr));
+ continue;
+ }
+ // Also covers FlagDesc settings
+ setDefault(setting.first, setting.second.value);
+ }
+}
+