common/setting: Make ranged a property of the type

- Avoids new GCC 12 warnings when Type is of form std::optional<T>
- Makes more sense this way, because ranged is not a property which would change over time
This commit is contained in:
merry
2022-07-15 18:37:48 +01:00
parent d2c0b45bca
commit 99fbdaf75b
6 changed files with 59 additions and 58 deletions

View File

@ -159,8 +159,8 @@ private:
*
* @param The setting
*/
template <typename Type>
void ReadGlobalSetting(Settings::SwitchableSetting<Type>& setting);
template <typename Type, bool ranged>
void ReadGlobalSetting(Settings::SwitchableSetting<Type, ranged>& setting);
/**
* Sets a value to the qt_config using the setting's label and default value. If the config is a
@ -168,8 +168,8 @@ private:
*
* @param The setting
*/
template <typename Type>
void WriteGlobalSetting(const Settings::SwitchableSetting<Type>& setting);
template <typename Type, bool ranged>
void WriteGlobalSetting(const Settings::SwitchableSetting<Type, ranged>& setting);
/**
* Reads a value from the qt_config using the setting's label and default value and applies the
@ -177,15 +177,15 @@ private:
*
* @param The setting
*/
template <typename Type>
void ReadBasicSetting(Settings::Setting<Type>& setting);
template <typename Type, bool ranged>
void ReadBasicSetting(Settings::Setting<Type, ranged>& setting);
/** Sets a value from the setting in the qt_config using the setting's label and default value.
*
* @param The setting
*/
template <typename Type>
void WriteBasicSetting(const Settings::Setting<Type>& setting);
template <typename Type, bool ranged>
void WriteBasicSetting(const Settings::Setting<Type, ranged>& setting);
ConfigType type;
std::unique_ptr<QSettings> qt_config;