소스 검색

config: Always delete control settings in ClearControlPlayerValues

t895 2 년 전
부모
커밋
adebc96a9c
1개의 변경된 파일2개의 추가작업 그리고 8개의 파일을 삭제
  1. 2 8
      src/frontend_common/config.cpp

+ 2 - 8
src/frontend_common/config.cpp

@@ -867,15 +867,9 @@ void Config::Reload() {
 }
 
 void Config::ClearControlPlayerValues() const {
-    // If key is an empty string, all keys in the current group() are removed.
+    // Removes the entire [Controls] section
     const char* section = Settings::TranslateCategory(Settings::Category::Controls);
-    CSimpleIniA::TNamesDepend keys;
-    config->GetAllKeys(section, keys);
-    for (const auto& key : keys) {
-        if (std::string(config->GetValue(section, key.pItem)).empty()) {
-            config->Delete(section, key.pItem);
-        }
-    }
+    config->Delete(section, nullptr, true);
 }
 
 const std::string& Config::GetConfigFilePath() const {