diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-01-30 00:36:17 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-30 00:36:17 +0100 |
| commit | a4122237ebecb92f47f628cd56d6d564ea137034 (patch) | |
| tree | 869657859ffeb9326aba8d4e81f2d479fdff0941 /Source/Core | |
| parent | 63df67b7c8350b6d1e991b877f78df67a31c3421 (diff) | |
| parent | ff071f8b75cd55ac8688817088fb10989eee4c97 (diff) | |
Merge pull request #10411 from AdmiralCurtiss/config-disallow-global-ini
Core/BaseConfigLoader: Disallow loading the MAIN_MEMORY_CARD_SIZE from the global config INI.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/ConfigLoaders/BaseConfigLoader.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/Core/Core/ConfigLoaders/BaseConfigLoader.cpp b/Source/Core/Core/ConfigLoaders/BaseConfigLoader.cpp index 9aa45f8714..7b9d1c2782 100644 --- a/Source/Core/Core/ConfigLoaders/BaseConfigLoader.cpp +++ b/Source/Core/Core/ConfigLoaders/BaseConfigLoader.cpp @@ -19,6 +19,7 @@ #include "Common/IniFile.h" #include "Common/Logging/Log.h" +#include "Core/Config/MainSettings.h" #include "Core/Config/SYSCONFSettings.h" #include "Core/ConfigLoaders/IsSettingSaveable.h" #include "Core/ConfigManager.h" @@ -103,6 +104,11 @@ public: BaseConfigLayerLoader() : ConfigLayerLoader(Config::LayerType::Base) {} void Load(Config::Layer* layer) override { + // List of settings that under no circumstances should be loaded from the global config INI. + static const auto s_setting_disallowed = { + &Config::MAIN_MEMORY_CARD_SIZE.GetLocation(), + }; + LoadFromSYSCONF(layer); for (const auto& system : system_to_ini) { @@ -118,6 +124,12 @@ public: for (const auto& value : section_map) { const Config::Location location{system.first, section_name, value.first}; + const bool load_disallowed = + std::any_of(begin(s_setting_disallowed), end(s_setting_disallowed), + [&location](const Config::Location* l) { return *l == location; }); + if (load_disallowed) + continue; + layer->Set(location, value.second); } } |
