Browse Source
Merge pull request #12986 from t895/input-config-clear-fix
config: Always delete control settings in ClearControlPlayerValues
pull/15/merge
liamwhite
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
2 additions and
8 deletions
-
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 { |
|
|
|
|