diff options
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 cbbb07ac7..2bebfeef9 100644 --- a/src/frontend_common/config.cpp +++ b/src/frontend_common/config.cpp | |||
| @@ -885,15 +885,9 @@ void Config::Reload() { | |||
| 885 | } | 885 | } |
| 886 | 886 | ||
| 887 | void Config::ClearControlPlayerValues() const { | 887 | void Config::ClearControlPlayerValues() const { |
| 888 | // If key is an empty string, all keys in the current group() are removed. | 888 | // Removes the entire [Controls] section |
| 889 | const char* section = Settings::TranslateCategory(Settings::Category::Controls); | 889 | const char* section = Settings::TranslateCategory(Settings::Category::Controls); |
| 890 | CSimpleIniA::TNamesDepend keys; | 890 | config->Delete(section, nullptr, true); |
| 891 | config->GetAllKeys(section, keys); | ||
| 892 | for (const auto& key : keys) { | ||
| 893 | if (std::string(config->GetValue(section, key.pItem)).empty()) { | ||
| 894 | config->Delete(section, key.pItem); | ||
| 895 | } | ||
| 896 | } | ||
| 897 | } | 891 | } |
| 898 | 892 | ||
| 899 | const std::string& Config::GetConfigFilePath() const { | 893 | const std::string& Config::GetConfigFilePath() const { |