diff options
Diffstat (limited to 'src/frontend_common/config.cpp')
-rw-r--r-- | src/frontend_common/config.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/frontend_common/config.cpp b/src/frontend_common/config.cpp index d34624d28..2bebfeef9 100644 --- a/src/frontend_common/config.cpp +++ b/src/frontend_common/config.cpp @@ -401,6 +401,14 @@ void Config::ReadNetworkValues() { EndGroup(); } +void Config::ReadLibraryAppletValues() { + BeginGroup(Settings::TranslateCategory(Settings::Category::LibraryApplet)); + + ReadCategory(Settings::Category::LibraryApplet); + + EndGroup(); +} + void Config::ReadValues() { if (global) { ReadDataStorageValues(); @@ -410,6 +418,7 @@ void Config::ReadValues() { ReadServiceValues(); ReadWebServiceValues(); ReadMiscellaneousValues(); + ReadLibraryAppletValues(); } ReadControlValues(); ReadCoreValues(); @@ -511,6 +520,7 @@ void Config::SaveValues() { SaveNetworkValues(); SaveWebServiceValues(); SaveMiscellaneousValues(); + SaveLibraryAppletValues(); } else { LOG_DEBUG(Config, "Saving only generic configuration values"); } @@ -691,6 +701,14 @@ void Config::SaveWebServiceValues() { EndGroup(); } +void Config::SaveLibraryAppletValues() { + BeginGroup(Settings::TranslateCategory(Settings::Category::LibraryApplet)); + + WriteCategory(Settings::Category::LibraryApplet); + + EndGroup(); +} + bool Config::ReadBooleanSetting(const std::string& key, const std::optional<bool> default_value) { std::string full_key = GetFullKey(key, false); if (!default_value.has_value()) { @@ -867,15 +885,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 { |