summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-05 15:25:23 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-05 15:25:23 +0300
commit8b3c79f23d910db0f2c031a828783c1c2273eaf7 (patch)
tree3cad056ba8aa09774675987d16bf3882c0592df8
parente3b9d60938b1299f2f66e68ff291060654c58d66 (diff)
downloadplus-8b3c79f23d910db0f2c031a828783c1c2273eaf7.tar.gz
plus-8b3c79f23d910db0f2c031a828783c1c2273eaf7.tar.bz2
plus-8b3c79f23d910db0f2c031a828783c1c2273eaf7.tar.xz
plus-8b3c79f23d910db0f2c031a828783c1c2273eaf7.zip
Fix remember checkbox in login dialog.
-rw-r--r--src/client.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/client.cpp b/src/client.cpp
index b91150626..9861696d4 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -933,9 +933,16 @@ int Client::gameExec()
mServerName = mCurrentServer.hostname;
initServerConfig(mCurrentServer.hostname);
if (mOptions.username.empty())
- loginData.username = serverConfig.getValue("username", "");
+ {
+ if (loginData.remember)
+ loginData.username = serverConfig.getValue("username", "");
+ else
+ loginData.username = "";
+ }
else
+ {
loginData.username = mOptions.username;
+ }
loginData.remember = serverConfig.getValue("remember", 1);
@@ -1957,6 +1964,8 @@ void Client::accountLogin(LoginData *data)
// than the login gui window
if (data->remember)
serverConfig.setValue("username", data->username);
+ else
+ serverConfig.setValue("username", "");
serverConfig.setValue("remember", data->remember);
}