From c4f14527c89959fa841690852517dc402932eeb7 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Fri, 18 Feb 2011 20:14:08 +0000 Subject: [PATCH] Fix getting the user's XMPP password for the first time --- src/remote/remoteconfig.cpp | 4 +++- src/remote/remoteconfig.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/remote/remoteconfig.cpp b/src/remote/remoteconfig.cpp index 908c4a3b7..b67f4d88c 100644 --- a/src/remote/remoteconfig.cpp +++ b/src/remote/remoteconfig.cpp @@ -96,6 +96,7 @@ void RemoteConfig::AuthenticationComplete(bool success) { waiting_for_auth_ = false; if (success) { + validated_password_ = ui_->password->text(); ui_->password->clear(); } else { QMessageBox::warning(this, tr("Authentication failed"), tr("Your Google credentials were incorrect")); @@ -119,7 +120,8 @@ void RemoteConfig::Save() { const QString& username = ui_->username->text(); s.setValue("username", username); Keychain* keychain = Keychain::getDefault(); - keychain->setPassword(username, ui_->password->text()); + keychain->setPassword(username, validated_password_); + validated_password_.clear(); } void RemoteConfig::SignOut() { diff --git a/src/remote/remoteconfig.h b/src/remote/remoteconfig.h index 042e05d07..7f9a12093 100644 --- a/src/remote/remoteconfig.h +++ b/src/remote/remoteconfig.h @@ -54,6 +54,8 @@ class RemoteConfig : public QWidget { Ui_RemoteConfig* ui_; bool waiting_for_auth_; NetworkAccessManager* network_; + + QString validated_password_; }; #endif // REMOTECONFIG_H