configuration: Defer to common/settings for per-game settings defaults

Avoids double-setting defaults, and avoids potential accidents when
inconsistently setting the default on new settings.
This commit is contained in:
lat9nq
2021-06-26 02:45:14 -04:00
parent 20e51402b0
commit 35b17fa5e0
2 changed files with 101 additions and 128 deletions

View File

@ -104,14 +104,14 @@ private:
QVariant ReadSetting(const QString& name) const;
QVariant ReadSetting(const QString& name, const QVariant& default_value) const;
QVariant ReadSetting(const QString& name, Settings::CPUAccuracy default_value) const;
QVariant ReadSetting(const QString& name, Settings::GPUAccuracy default_value) const;
QVariant ReadSetting(const QString& name, Settings::RendererBackend default_value) const;
// Templated ReadSettingGlobal functions will also look for the use_global setting and set
// both the value and the global state properly
template <typename Type>
void ReadSettingGlobal(Settings::Setting<Type>& setting, const QString& name);
template <typename Type>
void ReadSettingGlobal(Settings::Setting<Type>& setting, const QString& name,
const QVariant& default_value);
template <typename Type>
void ReadSettingGlobal(Type& setting, const QString& name, const QVariant& default_value) const;
// Templated WriteSettingGlobal functions will also write the global state if needed and will
// skip writing the actual setting if it defers to the global value