From bd7a78529da15acb0698453d77324cdc8a02005f Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Fri, 8 Jul 2011 08:41:54 +0100
Subject: Morph the login window into the roster before re-enabling login.

Resolves: #920

diff --git a/Swift/Controllers/Chat/UnitTest/MockChatListWindow.h b/Swift/Controllers/Chat/UnitTest/MockChatListWindow.h
index b1e1329..6ac8d4a 100644
--- a/Swift/Controllers/Chat/UnitTest/MockChatListWindow.h
+++ b/Swift/Controllers/Chat/UnitTest/MockChatListWindow.h
@@ -18,7 +18,7 @@ namespace Swift {
 			void removeMUCBookmark(const MUCBookmark& /*bookmark*/) {}
 			void setBookmarksEnabled(bool /*enabled*/) {}
 			void setRecents(const std::list<ChatListWindow::Chat>& /*recents*/) {}
-			void setUnreadCount(int unread) {}
+			void setUnreadCount(int /*unread*/) {}
 			void clearBookmarks() {}
 	};
 
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index 3d9d25a..58b2dbe 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -255,12 +255,13 @@ void MainController::resetCurrentError() {
 
 void MainController::handleConnected() {
 	boundJID_ = client_->getJID();
-	loginWindow_->setIsLoggingIn(false);
 	resetCurrentError();
 	resetPendingReconnects();
+
 	if (eagleMode_) {
 		purgeCachedCredentials();
 	}
+
 	bool freshLogin = rosterController_ == NULL;
 	myStatusLooksOnline_ = true;
 	if (freshLogin) {
@@ -290,7 +291,8 @@ void MainController::handleConnected() {
 		userSearchControllerAdd_ = new UserSearchController(UserSearchController::AddContact, jid_, uiEventStream_, uiFactory_, client_->getIQRouter(), rosterController_);
 		adHocManager_ = new AdHocManager(boundJID_, uiFactory_, client_->getIQRouter(), uiEventStream_, rosterController_->getWindow());
 	}
-	
+	loginWindow_->setIsLoggingIn(false);
+
 	client_->requestRoster();
 
 	GetDiscoInfoRequest::ref discoInfoRequest = GetDiscoInfoRequest::create(boundJID_.toBare(), client_->getIQRouter());
diff --git a/Swift/QtUI/ChatList/QtChatListWindow.cpp b/Swift/QtUI/ChatList/QtChatListWindow.cpp
index cfbbcb9..fab6374 100644
--- a/Swift/QtUI/ChatList/QtChatListWindow.cpp
+++ b/Swift/QtUI/ChatList/QtChatListWindow.cpp
@@ -99,7 +99,7 @@ void QtChatListWindow::setRecents(const std::list<ChatListWindow::Chat>& recents
 	model_->setRecents(recents);
 }
 
-void QtChatListWindow::setUnreadCount(int unread) {
+void QtChatListWindow::setUnreadCount(int /*unread*/) {
 
 }
 
-- 
cgit v0.10.2-6-g49f6