From 51bc86fc25f8ba511c0e9a89f8faf23273724142 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 25 Nov 2023 14:09:26 +0100 Subject: [PATCH 1/4] Config: Remove MAIN_USE_DISCORD_PRESENCE from s_setting_saveable It's already covered by Config::System::Main. --- Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp b/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp index ac8e70e10f..1835c4cab1 100644 --- a/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp +++ b/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp @@ -27,10 +27,6 @@ bool IsSettingSaveable(const Config::Location& config_location) } static const auto s_setting_saveable = { - // UI.General - - &Config::MAIN_USE_DISCORD_PRESENCE.GetLocation(), - // Wiimote &Config::WIIMOTE_1_SOURCE.GetLocation(), From 5c3517c31d6b704f3814e55251c9162cf36a74e4 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 25 Nov 2023 14:10:26 +0100 Subject: [PATCH 2/4] Config: Remove RA settings from s_setting_saveable We can cover them using Config::System::Achievements. --- .../Core/Core/ConfigLoaders/IsSettingSaveable.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp b/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp index 1835c4cab1..bf61183d64 100644 --- a/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp +++ b/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp @@ -20,7 +20,7 @@ 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::GameSettingsOnly, Config::System::Achievements}) { if (config_location.system == system) return true; @@ -34,19 +34,6 @@ bool IsSettingSaveable(const Config::Location& config_location) &Config::WIIMOTE_3_SOURCE.GetLocation(), &Config::WIIMOTE_4_SOURCE.GetLocation(), &Config::WIIMOTE_BB_SOURCE.GetLocation(), - - // Achievements - - &Config::RA_ENABLED.GetLocation(), - &Config::RA_USERNAME.GetLocation(), - &Config::RA_API_TOKEN.GetLocation(), - &Config::RA_ACHIEVEMENTS_ENABLED.GetLocation(), - &Config::RA_LEADERBOARDS_ENABLED.GetLocation(), - &Config::RA_RICH_PRESENCE_ENABLED.GetLocation(), - &Config::RA_PROGRESS_ENABLED.GetLocation(), - &Config::RA_BADGES_ENABLED.GetLocation(), - &Config::RA_UNOFFICIAL_ENABLED.GetLocation(), - &Config::RA_ENCORE_ENABLED.GetLocation(), }; return std::any_of(begin(s_setting_saveable), end(s_setting_saveable), From b18519320cab5b6951ed6858a2ed63269db0bb8c Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 25 Nov 2023 14:29:24 +0100 Subject: [PATCH 3/4] 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(), }; From be1e103435090483831c9a9f32aa765071ded05a Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 25 Nov 2023 14:32:54 +0100 Subject: [PATCH 4/4] Remove references to Debugger.ini This file was only used by DolphinWX. DolphinQt uses Qt.ini instead. --- Source/Core/Common/CommonPaths.h | 1 - Source/Core/Common/Config/Config.cpp | 1 - Source/Core/Common/Config/Enums.h | 1 - Source/Core/Common/FileUtil.cpp | 2 -- Source/Core/Common/FileUtil.h | 1 - Source/Core/Core/ConfigLoaders/BaseConfigLoader.cpp | 1 - Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp | 5 ++--- 7 files changed, 2 insertions(+), 10 deletions(-) diff --git a/Source/Core/Common/CommonPaths.h b/Source/Core/Common/CommonPaths.h index 44ada6dd19..4510842089 100644 --- a/Source/Core/Common/CommonPaths.h +++ b/Source/Core/Common/CommonPaths.h @@ -108,7 +108,6 @@ #define WIIPAD_CONFIG "WiimoteNew.ini" #define GCKEYBOARD_CONFIG "GCKeyNew.ini" #define GFX_CONFIG "GFX.ini" -#define DEBUGGER_CONFIG "Debugger.ini" #define LOGGER_CONFIG "Logger.ini" #define DUALSHOCKUDPCLIENT_CONFIG "DSUClient.ini" #define FREELOOK_CONFIG "FreeLook.ini" diff --git a/Source/Core/Common/Config/Config.cpp b/Source/Core/Common/Config/Config.cpp index 3f008fc913..00dbab7bb4 100644 --- a/Source/Core/Common/Config/Config.cpp +++ b/Source/Core/Common/Config/Config.cpp @@ -154,7 +154,6 @@ static const std::map system_to_name = { {System::GCKeyboard, "GCKeyboard"}, {System::GFX, "Graphics"}, {System::Logger, "Logger"}, - {System::Debugger, "Debugger"}, {System::SYSCONF, "SYSCONF"}, {System::DualShockUDPClient, "DualShockUDPClient"}, {System::FreeLook, "FreeLook"}, diff --git a/Source/Core/Common/Config/Enums.h b/Source/Core/Common/Config/Enums.h index 69d8c954c3..80ccdde9f3 100644 --- a/Source/Core/Common/Config/Enums.h +++ b/Source/Core/Common/Config/Enums.h @@ -29,7 +29,6 @@ enum class System GCKeyboard, GFX, Logger, - Debugger, DualShockUDPClient, FreeLook, Session, diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index eb880c51ad..4b211fec5e 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -872,7 +872,6 @@ static void RebuildUserDirectories(unsigned int dir_index) s_user_paths[F_WIIPADCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + WIIPAD_CONFIG; s_user_paths[F_GCKEYBOARDCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + GCKEYBOARD_CONFIG; s_user_paths[F_GFXCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + GFX_CONFIG; - s_user_paths[F_DEBUGGERCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + DEBUGGER_CONFIG; s_user_paths[F_LOGGERCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + LOGGER_CONFIG; s_user_paths[F_DUALSHOCKUDPCLIENTCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + DUALSHOCKUDPCLIENT_CONFIG; @@ -908,7 +907,6 @@ static void RebuildUserDirectories(unsigned int dir_index) s_user_paths[F_GCKEYBOARDCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + GCKEYBOARD_CONFIG; s_user_paths[F_WIIPADCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + WIIPAD_CONFIG; s_user_paths[F_GFXCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + GFX_CONFIG; - s_user_paths[F_DEBUGGERCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + DEBUGGER_CONFIG; s_user_paths[F_LOGGERCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + LOGGER_CONFIG; s_user_paths[F_DUALSHOCKUDPCLIENTCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + DUALSHOCKUDPCLIENT_CONFIG; diff --git a/Source/Core/Common/FileUtil.h b/Source/Core/Common/FileUtil.h index 8d5f312d65..276dd6caa8 100644 --- a/Source/Core/Common/FileUtil.h +++ b/Source/Core/Common/FileUtil.h @@ -77,7 +77,6 @@ enum F_WIIPADCONFIG_IDX, F_GCKEYBOARDCONFIG_IDX, F_GFXCONFIG_IDX, - F_DEBUGGERCONFIG_IDX, F_LOGGERCONFIG_IDX, F_MAINLOG_IDX, F_MEM1DUMP_IDX, diff --git a/Source/Core/Core/ConfigLoaders/BaseConfigLoader.cpp b/Source/Core/Core/ConfigLoaders/BaseConfigLoader.cpp index 1e6d2efca3..0b9aa61fd7 100644 --- a/Source/Core/Core/ConfigLoaders/BaseConfigLoader.cpp +++ b/Source/Core/Core/ConfigLoaders/BaseConfigLoader.cpp @@ -80,7 +80,6 @@ const std::map system_to_ini = { {Config::System::GCKeyboard, F_GCKEYBOARDCONFIG_IDX}, {Config::System::GFX, F_GFXCONFIG_IDX}, {Config::System::Logger, F_LOGGERCONFIG_IDX}, - {Config::System::Debugger, F_DEBUGGERCONFIG_IDX}, {Config::System::DualShockUDPClient, F_DUALSHOCKUDPCLIENTCONFIG_IDX}, {Config::System::FreeLook, F_FREELOOKCONFIG_IDX}, {Config::System::Achievements, F_RETROACHIEVEMENTSCONFIG_IDX}, diff --git a/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp b/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp index 7148737088..fd47ede19e 100644 --- a/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp +++ b/Source/Core/Core/ConfigLoaders/IsSettingSaveable.cpp @@ -17,9 +17,8 @@ namespace ConfigLoaders { bool IsSettingSaveable(const Config::Location& config_location) { - static constexpr std::array systems_not_saveable = { - Config::System::GCPad, Config::System::WiiPad, Config::System::GCKeyboard, - Config::System::Debugger}; + static constexpr std::array systems_not_saveable = { + Config::System::GCPad, Config::System::WiiPad, Config::System::GCKeyboard}; if (std::find(begin(systems_not_saveable), end(systems_not_saveable), config_location.system) == end(systems_not_saveable))