diff options
| author | 2024-02-11 12:24:18 -0500 | |
|---|---|---|
| committer | 2024-02-11 12:24:18 -0500 | |
| commit | 98db796fde40f7a82201782e62a2f353238c492e (patch) | |
| tree | a0301223c7cea69bdd1571461fb750f044c7803b /src/frontend_common/config.cpp | |
| parent | Merge pull request #12981 from lat9nq/tzdb-asan-custom (diff) | |
| parent | config: Always delete control settings in ClearControlPlayerValues (diff) | |
| download | yuzu-98db796fde40f7a82201782e62a2f353238c492e.tar.gz yuzu-98db796fde40f7a82201782e62a2f353238c492e.tar.xz yuzu-98db796fde40f7a82201782e62a2f353238c492e.zip | |
Merge pull request #12986 from t895/input-config-clear-fix
config: Always delete control settings in ClearControlPlayerValues
Diffstat (limited to 'src/frontend_common/config.cpp')
| -rw-r--r-- | src/frontend_common/config.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/frontend_common/config.cpp b/src/frontend_common/config.cpp index d34624d28..af6b10db6 100644 --- a/src/frontend_common/config.cpp +++ b/src/frontend_common/config.cpp | |||
| @@ -867,15 +867,9 @@ void Config::Reload() { | |||
| 867 | } | 867 | } |
| 868 | 868 | ||
| 869 | void Config::ClearControlPlayerValues() const { | 869 | void Config::ClearControlPlayerValues() const { |
| 870 | // If key is an empty string, all keys in the current group() are removed. | 870 | // Removes the entire [Controls] section |
| 871 | const char* section = Settings::TranslateCategory(Settings::Category::Controls); | 871 | const char* section = Settings::TranslateCategory(Settings::Category::Controls); |
| 872 | CSimpleIniA::TNamesDepend keys; | 872 | config->Delete(section, nullptr, true); |
| 873 | config->GetAllKeys(section, keys); | ||
| 874 | for (const auto& key : keys) { | ||
| 875 | if (std::string(config->GetValue(section, key.pItem)).empty()) { | ||
| 876 | config->Delete(section, key.pItem); | ||
| 877 | } | ||
| 878 | } | ||
| 879 | } | 873 | } |
| 880 | 874 | ||
| 881 | const std::string& Config::GetConfigFilePath() const { | 875 | const std::string& Config::GetConfigFilePath() const { |