Fixed an issue where the IgnoreGamelist setting was saved although it shouldn't.

Also made a change so that passing the --ignore-gamelist command line option now immediately disables the ParseGamelistOnly setting.
This commit is contained in:
Leon Styhre 2022-06-29 17:17:31 +02:00
parent 077fb00f96
commit 08d893b119
2 changed files with 7 additions and 2 deletions

View file

@ -337,6 +337,7 @@ bool parseArgs(int argc, char* argv[])
}
else if (strcmp(argv[i], "--gamelist-only") == 0) {
Settings::getInstance()->setBool("ParseGamelistOnly", true);
settingsNeedSaving = true;
}
else if (strcmp(argv[i], "--ignore-gamelist") == 0) {
Settings::getInstance()->setBool("IgnoreGamelist", true);
@ -409,6 +410,11 @@ bool parseArgs(int argc, char* argv[])
}
}
if (Settings::getInstance()->getBool("IgnoreGamelist")) {
Settings::getInstance()->setBool("ParseGamelistOnly", false);
settingsNeedSaving = true;
}
return true;
}

View file

@ -29,7 +29,6 @@ namespace
// These options can be set using command-line arguments:
"WindowWidth", // Set via --resolution [width] [height]
"WindowHeight", // set via --resolution [width] [height]
"ParseGamelistOnly" // --gamelist-only
"IgnoreGamelist", // --ignore-gamelist
"SplashScreen", // --no-splash
"Debug", // --debug
@ -359,7 +358,7 @@ void Settings::loadFile()
pugi::xml_parse_result result = doc.load_file(configFile.c_str());
#endif
if (!result) {
LOG(LogError) << "Could not parse the es_settings.xml file\n " << result.description();
LOG(LogError) << "Couldn't parse the es_settings.xml file: " << result.description();
return;
}