summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorZi Ree <none@none>2012-04-10 16:01:46 -0400
committerZi Ree <none@none>2012-04-10 16:01:46 -0400
commit2b0318ffd07b20a523c58156718ffab1a9d51271 (patch)
tree72128f66badbaea99fb191ec589e20f564de13b1 /indra/newview/llappviewer.cpp
parent289d756ea86bd3898f41592146d8f549cd056846 (diff)
STORM-1842 Don't save per-account settings if login not fully successful
Repo created from Firestorm patch by Jonathan Yap
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 49fbdbf1df..c0197db4fc 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -622,6 +622,7 @@ LLAppViewer::LLAppViewer() :
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 @@ bool LLAppViewer::cleanup()
{
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 @@ void LLAppViewer::handleLoginComplete()
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