mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-12-20 23:40:56 +01:00
config: Always delete control settings in ClearControlPlayerValues
This commit is contained in:
parent
564a65a82e
commit
adebc96a9c
1 changed files with 2 additions and 8 deletions
|
@ -867,15 +867,9 @@ void Config::Reload() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::ClearControlPlayerValues() const {
|
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);
|
const char* section = Settings::TranslateCategory(Settings::Category::Controls);
|
||||||
CSimpleIniA::TNamesDepend keys;
|
config->Delete(section, nullptr, true);
|
||||||
config->GetAllKeys(section, keys);
|
|
||||||
for (const auto& key : keys) {
|
|
||||||
if (std::string(config->GetValue(section, key.pItem)).empty()) {
|
|
||||||
config->Delete(section, key.pItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& Config::GetConfigFilePath() const {
|
const std::string& Config::GetConfigFilePath() const {
|
||||||
|
|
Loading…
Reference in a new issue