Fix first-time tips not displaying

If settings.yaml is deleted or the lastVersion key is missing.
This commit is contained in:
Oliver Hamlet
2016-05-12 21:12:25 +01:00
parent 9c7bef8e01
commit 0d6c0c70be
2 changed files with 2 additions and 3 deletions
+1 -2
View File
@@ -50,8 +50,7 @@ namespace loot {
updateMasterlist(true),
game("auto"),
language(Language(Language::english)),
lastGame("auto"),
lastVersion(std::to_string(g_version_major) + "." + std::to_string(g_version_minor) + "." + std::to_string(g_version_patch)) {}
lastGame("auto") {}
void LootSettings::load(YAML::Node& settings) {
std::lock_guard<std::recursive_mutex> guard(mutex);
+1 -1
View File
@@ -64,7 +64,7 @@ namespace loot {
const YAML::Node node = settings.toYaml();
EXPECT_TRUE(node["updateMasterlist"].as<bool>());
EXPECT_EQ(currentVersion, node["lastVersion"].as<std::string>());
EXPECT_TRUE(node["lastVersion"].as<std::string>().empty());
EXPECT_FALSE(node["filters"]);
// GameSettings equality only checks name and folder, so check