From b18519320cab5b6951ed6858a2ed63269db0bb8c Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 25 Nov 2023 14:29:24 +0100 Subject: [PATCH] Config: Flip the IsSettingSaveable system check Nowadays, basically everything except for controller config is handled by the new config system. Instead of enumerating the systems that are, let's enumerate the systems that aren't. I've intentionally not included Config::System::Session in the new list. While it isn't intended to be saved, it is a setting that's fully handled by the new config system. See https://github.com/dolphin-emu/dolphin/pull/9804#discussion_r648949686. --- .../Core/ConfigLoaders/IsSettingSaveable.cpp | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp b/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp index bf61183d64..7148737088 100644 --- a/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp +++ b/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp @@ -4,7 +4,7 @@ #include "Core/ConfigLoaders/IsSettingSaveable.h" #include -#include +#include #include "Common/Config/Config.h" #include "Core/Config/AchievementSettings.h" @@ -17,22 +17,19 @@ namespace ConfigLoaders { bool IsSettingSaveable(const Config::Location& config_location) { - for (Config::System system : - {Config::System::SYSCONF, Config::System::GFX, Config::System::DualShockUDPClient, - Config::System::Logger, Config::System::FreeLook, Config::System::Main, - Config::System::GameSettingsOnly, Config::System::Achievements}) + static constexpr std::array systems_not_saveable = { + Config::System::GCPad, Config::System::WiiPad, Config::System::GCKeyboard, + Config::System::Debugger}; + + if (std::find(begin(systems_not_saveable), end(systems_not_saveable), config_location.system) == + end(systems_not_saveable)) { - if (config_location.system == system) - return true; + return true; } static const auto s_setting_saveable = { - // Wiimote - - &Config::WIIMOTE_1_SOURCE.GetLocation(), - &Config::WIIMOTE_2_SOURCE.GetLocation(), - &Config::WIIMOTE_3_SOURCE.GetLocation(), - &Config::WIIMOTE_4_SOURCE.GetLocation(), + &Config::WIIMOTE_1_SOURCE.GetLocation(), &Config::WIIMOTE_2_SOURCE.GetLocation(), + &Config::WIIMOTE_3_SOURCE.GetLocation(), &Config::WIIMOTE_4_SOURCE.GetLocation(), &Config::WIIMOTE_BB_SOURCE.GetLocation(), };