Bug fix for Login e-mail field is not pre-filled after failed login attempt
authorlampehe-local <henri.lampela@ixonos.com>
Wed, 2 Jun 2010 06:12:16 +0000 (09:12 +0300)
committerlampehe-local <henri.lampela@ixonos.com>
Wed, 2 Jun 2010 06:12:16 +0000 (09:12 +0300)
Reviewed by: Kaj Wallin

src/engine/engine.cpp
src/ui/mainwindow.cpp
src/ui/mainwindow.h

index bd06d4b..267cb41 100644 (file)
@@ -262,9 +262,6 @@ void SituareEngine::loginOk()
     m_loggedIn = true;
     m_ui->loggedIn(m_loggedIn);
 
-    if(!m_ui->username().isEmpty())
-        m_facebookAuthenticator->saveUsername(m_ui->username());
-
     m_ui->show();
     m_situareService->fetchLocations(); // request user locations
 }
@@ -389,15 +386,18 @@ void SituareEngine::signalsFromMainWindow()
 {
     qDebug() << __PRETTY_FUNCTION__;    
 
+    connect(m_ui, SIGNAL(fetchUsernameFromSettings()),
+            this, SLOT(fetchUsernameFromSettings()));
+
     connect(m_ui, SIGNAL(loginActionPressed()),
             this, SLOT(loginActionPressed()));
 
+    connect(m_ui, SIGNAL(saveUsername(QString)),
+            m_facebookAuthenticator, SLOT(saveUsername(QString)));
+
     connect(m_ui, SIGNAL(updateCredentials(QUrl)),
             m_facebookAuthenticator, SLOT(updateCredentials(QUrl)));
 
-    connect(m_ui, SIGNAL(fetchUsernameFromSettings()),
-            this, SLOT(fetchUsernameFromSettings()));
-
     // signals from map view
     connect(m_ui, SIGNAL(mapViewScrolled(QPoint)),
             m_mapEngine, SLOT(setLocation(QPoint)));
index 6b453d7..c412071 100644 (file)
@@ -654,6 +654,7 @@ void MainWindow::startLoginProcess(const QUrl &url)
     }
     else {
         loginDialog.userInput(m_email, m_password);
+        emit saveUsername(m_email);
         m_webView->load(url);
         toggleProgressIndicator(true);
         m_refresh = true;
index 8185c55..55df773 100644 (file)
@@ -412,6 +412,13 @@ signals:
     void reverseGeoReady(const QString &address);
 
     /**
+    * @brief Signal to save username to settings
+    *
+    * @param username Username
+    */
+    void saveUsername(const QString &username);
+
+    /**
     * @brief Signal for requestLocationUpdate from SituareEngine
     *
     * @param status Status message