Fix masterlist update not updating stored metadata

This commit is contained in:
Oliver Hamlet
2017-02-06 18:49:46 +00:00
parent b92d5cb0ea
commit ef4cedab86
4 changed files with 20 additions and 9 deletions
+5 -5
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: LOOT 0.10.3\n"
"Report-Msgid-Bugs-To: https://github.com/loot/loot/issues\n"
"POT-Creation-Date: 2017-02-05 13:37+0000\n"
"POT-Creation-Date: 2017-02-06 18:49+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -726,7 +726,7 @@ msgstr ""
msgid "You have not sorted your load order this session."
msgstr ""
#: src/gui/state/game.cpp:369
#: src/gui/state/game.cpp:374
msgid ""
"An error occurred while parsing the metadata list(s): %1%.\n"
"\n"
@@ -744,15 +744,15 @@ msgid ""
"[LOOT's website](https://loot.github.io/)."
msgstr ""
#: src/gui/state/loot_state.cpp:131
#: src/gui/state/loot_state.cpp:133
msgid "Error: Could not create LOOT settings file. %1%"
msgstr ""
#: src/gui/state/loot_state.cpp:138
#: src/gui/state/loot_state.cpp:140
msgid "Error: Settings parsing failed. %1%"
msgstr ""
#: src/gui/state/loot_state.cpp:205
#: src/gui/state/loot_state.cpp:207
msgid "Error: Game-specific settings could not be initialised. %1%"
msgstr ""
+7 -1
View File
@@ -104,7 +104,13 @@ bool ApiDatabase::UpdateMasterlist(const std::string& masterlistPath,
throw std::invalid_argument("Given masterlist path \"" + masterlistPath + "\" does not have a valid parent directory.");
Masterlist masterlist;
return masterlist.Update(masterlistPath, remoteURL, remoteBranch);
if (masterlist.Update(masterlistPath, remoteURL, remoteBranch)) {
game_.GetMasterlist() = masterlist;
unevaluatedMasterlist_ = masterlist;
return true;
}
return false;
}
MasterlistInfo ApiDatabase::GetMasterlistRevision(const std::string& masterlistPath,
+7 -2
View File
@@ -339,8 +339,13 @@ void Game::ClearMessages() {
messages_.clear();
}
bool Game::UpdateMasterlist() const {
return gameHandle_->GetDatabase()->UpdateMasterlist(MasterlistPath().string(), RepoURL(), RepoBranch());
bool Game::UpdateMasterlist() {
if (gameHandle_->GetDatabase()->UpdateMasterlist(MasterlistPath().string(), RepoURL(), RepoBranch())) {
EvaluateLoadedMetadata();
return true;
}
return false;
}
MasterlistInfo Game::GetMasterlistInfo() const {
+1 -1
View File
@@ -77,7 +77,7 @@ public:
void AppendMessage(const Message& message);
void ClearMessages();
bool UpdateMasterlist() const;
bool UpdateMasterlist();
MasterlistInfo GetMasterlistInfo() const;
void LoadMetadata();