From 0a6e8ec9afb1e562ae244aa925fd7ee851246101 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sun, 7 Dec 2014 19:32:03 +0000 Subject: [PATCH] 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. --- src/gui/handler.cpp | 4 ++++ src/gui/main_win.cpp | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/handler.cpp b/src/gui/handler.cpp index 35c51d07..5ead8684 100644 --- a/src/gui/handler.cpp +++ b/src/gui/handler.cpp @@ -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); diff --git a/src/gui/main_win.cpp b/src/gui/main_win.cpp index 1d097e43..06a31e73 100644 --- a/src/gui/main_win.cpp +++ b/src/gui/main_win.cpp @@ -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");