From 99fbdaf75b18dd4cdaad1e93fa2a4ad82b0591aa Mon Sep 17 00:00:00 2001 From: merry Date: Fri, 15 Jul 2022 18:37:48 +0100 Subject: common/setting: Make ranged a property of the type - Avoids new GCC 12 warnings when Type is of form std::optional - Makes more sense this way, because ranged is not a property which would change over time --- src/yuzu/configuration/configuration_shared.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/yuzu/configuration/configuration_shared.h') diff --git a/src/yuzu/configuration/configuration_shared.h b/src/yuzu/configuration/configuration_shared.h index 77802a367..56800b6ff 100644 --- a/src/yuzu/configuration/configuration_shared.h +++ b/src/yuzu/configuration/configuration_shared.h @@ -27,8 +27,9 @@ enum class CheckState { // ApplyPerGameSetting, given a Settings::Setting and a Qt UI element, properly applies a Setting void ApplyPerGameSetting(Settings::SwitchableSetting* setting, const QCheckBox* checkbox, const CheckState& tracker); -template -void ApplyPerGameSetting(Settings::SwitchableSetting* setting, const QComboBox* combobox) { +template +void ApplyPerGameSetting(Settings::SwitchableSetting* setting, + const QComboBox* combobox) { if (Settings::IsConfiguringGlobal() && setting->UsingGlobal()) { setting->SetValue(static_cast(combobox->currentIndex())); } else if (!Settings::IsConfiguringGlobal()) { @@ -45,8 +46,9 @@ void ApplyPerGameSetting(Settings::SwitchableSetting* setting, const QComb // Sets a Qt UI element given a Settings::Setting void SetPerGameSetting(QCheckBox* checkbox, const Settings::SwitchableSetting* setting); -template -void SetPerGameSetting(QComboBox* combobox, const Settings::SwitchableSetting* setting) { +template +void SetPerGameSetting(QComboBox* combobox, + const Settings::SwitchableSetting* setting) { combobox->setCurrentIndex(setting->UsingGlobal() ? ConfigurationShared::USE_GLOBAL_INDEX : static_cast(setting->GetValue()) + ConfigurationShared::USE_GLOBAL_OFFSET); -- cgit v1.2.3