VERY experimental Nintendo Switch 2 emulator
C++
configuration_shared: Drop unused function and template another
lat9nqec31c71a34b8
diff --git a/src/yuzu/configuration/configuration_shared.cpp b/src/yuzu/configuration/configuration_shared.cppindex 83ec83745f..096e42e945 100644--- a/src/yuzu/configuration/configuration_shared.cpp+++ b/src/yuzu/configuration/configuration_shared.cpp@@ -39,21 +39,6 @@ void ConfigurationShared::ApplyPerGameSetting(Settings::Setting<int>* setting,}}-void ConfigurationShared::ApplyPerGameSetting(Settings::Setting<Settings::RendererBackend>* setting,- const QComboBox* combobox) {- if (Settings::IsConfiguringGlobal() && setting->UsingGlobal()) {- setting->SetValue(static_cast<Settings::RendererBackend>(combobox->currentIndex()));- } else if (!Settings::IsConfiguringGlobal()) {- if (combobox->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) {- setting->SetGlobal(true);- } else {- setting->SetGlobal(false);- setting->SetValue(static_cast<Settings::RendererBackend>(- combobox->currentIndex() - ConfigurationShared::USE_GLOBAL_OFFSET));- }- }-}-void ConfigurationShared::SetPerGameSetting(QCheckBox* checkbox,const Settings::Setting<bool>* setting) {if (setting->UsingGlobal()) {@@ -63,34 +48,6 @@ void ConfigurationShared::SetPerGameSetting(QCheckBox* checkbox,}}-void ConfigurationShared::SetPerGameSetting(QComboBox* combobox,- const Settings::Setting<int>* setting) {- combobox->setCurrentIndex(setting->UsingGlobal()- ? ConfigurationShared::USE_GLOBAL_INDEX- : setting->GetValue() + ConfigurationShared::USE_GLOBAL_OFFSET);-}--void ConfigurationShared::SetPerGameSetting(- QComboBox* combobox, const Settings::Setting<Settings::RendererBackend>* setting) {- combobox->setCurrentIndex(setting->UsingGlobal() ? ConfigurationShared::USE_GLOBAL_INDEX- : static_cast<int>(setting->GetValue()) +- ConfigurationShared::USE_GLOBAL_OFFSET);-}--void ConfigurationShared::SetPerGameSetting(- QComboBox* combobox, const Settings::Setting<Settings::GPUAccuracy>* setting) {- combobox->setCurrentIndex(setting->UsingGlobal() ? ConfigurationShared::USE_GLOBAL_INDEX- : static_cast<int>(setting->GetValue()) +- ConfigurationShared::USE_GLOBAL_OFFSET);-}--void ConfigurationShared::SetPerGameSetting(- QComboBox* combobox, const Settings::Setting<Settings::CPUAccuracy>* setting) {- combobox->setCurrentIndex(setting->UsingGlobal() ? ConfigurationShared::USE_GLOBAL_INDEX- : static_cast<int>(setting->GetValue()) +- ConfigurationShared::USE_GLOBAL_OFFSET);-}-void ConfigurationShared::SetHighlight(QWidget* widget, bool highlighted) {if (highlighted) {widget->setStyleSheet(QStringLiteral("QWidget#%1 { background-color:rgba(0,203,255,0.5) }")diff --git a/src/yuzu/configuration/configuration_shared.h b/src/yuzu/configuration/configuration_shared.hindex 13f313a93e..1e0ef01caa 100644--- a/src/yuzu/configuration/configuration_shared.h+++ b/src/yuzu/configuration/configuration_shared.h@@ -29,18 +29,16 @@ enum class CheckState {void ApplyPerGameSetting(Settings::Setting<bool>* setting, const QCheckBox* checkbox,const CheckState& tracker);void ApplyPerGameSetting(Settings::Setting<int>* setting, const QComboBox* combobox);-void ApplyPerGameSetting(Settings::Setting<Settings::RendererBackend>* setting,- const QComboBox* combobox);// Sets a Qt UI element given a Settings::Settingvoid SetPerGameSetting(QCheckBox* checkbox, const Settings::Setting<bool>* setting);-void SetPerGameSetting(QComboBox* combobox, const Settings::Setting<int>* setting);-void SetPerGameSetting(QComboBox* combobox,- const Settings::Setting<Settings::RendererBackend>* setting);-void SetPerGameSetting(QComboBox* combobox,- const Settings::Setting<Settings::GPUAccuracy>* setting);-void SetPerGameSetting(QComboBox* combobox,- const Settings::Setting<Settings::CPUAccuracy>* setting);++template <typename Type>+void SetPerGameSetting(QComboBox* combobox, const Settings::Setting<Type>* setting) {+ combobox->setCurrentIndex(setting->UsingGlobal() ? ConfigurationShared::USE_GLOBAL_INDEX+ : static_cast<int>(setting->GetValue()) ++ ConfigurationShared::USE_GLOBAL_OFFSET);+}// (Un)highlights a Qt UI elementvoid SetHighlight(QWidget* widget, bool highlighted);