diff -r 0a41a8750048 -r 996b9b04f363 doc/contributions.txt --- a/doc/contributions.txt Mon Feb 06 10:01:09 2012 -0500 +++ b/doc/contributions.txt Tue May 01 12:19:00 2012 -0400 @@ -610,6 +610,7 @@ STORM-1788 STORM-1799 STORM-1796 + STORM-1842 Kadah Coba STORM-1060 Jondan Lundquist @@ -1262,6 +1263,7 @@ VWR-24017 VWR-25588 STORM-1790 + STORM-1842 Zipherius Turas VWR-76 VWR-77 diff -r 0a41a8750048 -r 996b9b04f363 indra/newview/llappviewer.h --- a/indra/newview/llappviewer.h Mon Feb 06 10:01:09 2012 -0500 +++ b/indra/newview/llappviewer.h Tue May 01 12:19:00 2012 -0400 @@ -251,6 +251,7 @@ bool mPurgeOnExit; bool mSavedFinalSnapshot; + bool mSavePerAccountSettings; // only save per account settings if login succeeded bool mForceGraphicsDetail; diff -r 0a41a8750048 -r 996b9b04f363 indra/newview/llappviewer.cpp --- a/indra/newview/llappviewer.cpp Mon Feb 06 10:01:09 2012 -0500 +++ b/indra/newview/llappviewer.cpp Tue May 01 12:19:00 2012 -0400 @@ -622,6 +622,7 @@ mPurgeOnExit(false), mSecondInstance(false), mSavedFinalSnapshot(false), + mSavePerAccountSettings(false), // don't save settings on logout unless login succeeded. mForceGraphicsDetail(false), mQuitRequested(false), mLogoutRequestSent(false), @@ -1739,6 +1740,13 @@ { llinfos << "Not saving per-account settings; don't know the account name yet." << llendl; } + // Only save per account settings if the previous login succeeded, otherwise + // we might end up with a cleared out settings file in case a previous login + // failed after loading per account settings. + else if (!mSavePerAccountSettings) + { + llinfos << "Not saving per-account settings; last login was not successful." << llendl; + } else { gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE); @@ -4953,6 +4961,10 @@ mOnLoginCompleted(); writeDebugInfo(); + + // we logged in successfully, so save settings on logout + llinfos << "Login successful, per account settings will be saved on log out." << llendl; + mSavePerAccountSettings=true; } // *TODO - generalize this and move DSO wrangling to a helper class -brad