From 4945e1e38c56811998fa4a8b39c595cb4fbc3d9b Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Sun, 22 May 2011 13:49:43 +0100
Subject: Only forget login details in eagle mode


diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp
index 45d7c7e..a0823d0 100644
--- a/Swift/QtUI/QtLoginWindow.cpp
+++ b/Swift/QtUI/QtLoginWindow.cpp
@@ -39,7 +39,7 @@
 
 namespace Swift{
 
-QtLoginWindow::QtLoginWindow(UIEventStream* uiEventStream) : QMainWindow() {
+QtLoginWindow::QtLoginWindow(UIEventStream* uiEventStream) : QMainWindow(), forgetful_(false) {
 	uiEventStream_ = uiEventStream;
 
 	setWindowTitle("Swift");
@@ -198,6 +198,7 @@ QtLoginWindow::QtLoginWindow(UIEventStream* uiEventStream) : QMainWindow() {
 }
 
 void QtLoginWindow::setRememberingAllowed(bool allowed) {
+	forgetful_ = true;
 	remember_->setEnabled(allowed);
 	loginAutomatically_->setEnabled(allowed);
 	if (!allowed) {
@@ -313,7 +314,7 @@ void QtLoginWindow::setIsLoggingIn(bool loggingIn) {
 void QtLoginWindow::loginClicked() {
 	if (username_->isEnabled()) {
 		onLoginRequest(Q2PSTRING(username_->currentText()), Q2PSTRING(password_->text()), Q2PSTRING(certificateFile_), remember_->isChecked(), loginAutomatically_->isChecked());
-		if (!remember_->isEnabled()) { /* Mustn't remember logins */
+		if (forgetful_) { /* Mustn't remember logins */
 			username_->clearEditText();
 			password_->setText("");
 		}
diff --git a/Swift/QtUI/QtLoginWindow.h b/Swift/QtUI/QtLoginWindow.h
index 410ed0a..b2c547e 100644
--- a/Swift/QtUI/QtLoginWindow.h
+++ b/Swift/QtUI/QtLoginWindow.h
@@ -86,5 +86,6 @@ namespace Swift {
 			QAction* toggleNotificationsAction_;
 			UIEventStream* uiEventStream_;
 			QPointer<QtAboutWidget> aboutDialog_;
+			bool forgetful_;
 	};
 }
-- 
cgit v0.10.2-6-g49f6