Fix error in parsing settings file for 'empty' values.

This commit is contained in:
Stephen Anthony 2018-08-31 16:15:38 -02:30
parent 020d8b18c2
commit 6b76031234
2 changed files with 4 additions and 4 deletions

View File

@ -226,8 +226,8 @@ void Settings::loadConfig()
key = trim(key);
value = trim(value);
// Check for absent key or value
if((key.length() == 0) || (value.length() == 0))
// Skip absent key
if(key.length() == 0)
continue;
// Only settings which have been previously set are valid

View File

@ -475,7 +475,7 @@ void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DeveloperDialog::loadSettings(SettingsSet set)
{
string prefix = set == SettingsSet::player ? "plr." : "dev.";
const string& prefix = set == SettingsSet::player ? "plr." : "dev.";
myFrameStats[set] = instance().settings().getBool(prefix + "stats");
myConsole[set] = instance().settings().getString(prefix + "console") == "7800" ? 1 : 0;
@ -509,7 +509,7 @@ void DeveloperDialog::loadSettings(SettingsSet set)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DeveloperDialog::saveSettings(SettingsSet set)
{
string prefix = set == SettingsSet::player ? "plr." : "dev.";
const string& prefix = set == SettingsSet::player ? "plr." : "dev.";
instance().settings().setValue(prefix + "stats", myFrameStats[set]);
instance().settings().setValue(prefix + "console", myConsole[set] == 1 ? "7800" : "2600");