Userlist is now saved when applying edits.

As opposed to when the application message loop ends. This fixes #351.
The saving of settings has also been moved to a more appropriate point.
This commit is contained in:
Oliver Hamlet
2014-12-07 19:32:03 +00:00
parent 72cfafdf27
commit 0a6e8ec9af
2 changed files with 4 additions and 4 deletions
+4
View File
@@ -486,6 +486,9 @@ namespace loot {
g_app_state.CurrentGame().userlist.AddPlugin(newUserlistEntry);
}
// Save edited userlist.
g_app_state.CurrentGame().userlist.Save(g_app_state.CurrentGame().UserlistPath());
// Now rederive the derived metadata.
BOOST_LOG_TRIVIAL(trace) << "Returning newly derived display metadata.";
YAML::Node derivedMetadata = GenerateDerivedMetadata(newUserlistEntry.Name());
@@ -1167,6 +1170,7 @@ namespace loot {
#endif
g_app_state.UpdateSettings(settings);
g_app_state.SaveSettings();
// Cancel any javascript callbacks.
browser_side_router_->OnBeforeClose(browser);
-4
View File
@@ -135,10 +135,6 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmd
if (hMutex != NULL)
ReleaseMutex(hMutex);
// Now save LOOT's settings and user metadata.
g_app_state.CurrentGame().userlist.Save(g_app_state.CurrentGame().UserlistPath());
g_app_state.SaveSettings();
// Delete the folders CEF generates that LOOT doesn't need.
boost::filesystem::remove_all(boost::filesystem::current_path() / "locales");
boost::filesystem::remove_all(boost::filesystem::current_path() / "pdf.dll");