From: lampehe-local Date: Wed, 2 Jun 2010 06:12:16 +0000 (+0300) Subject: Bug fix for Login e-mail field is not pre-filled after failed login attempt X-Git-Tag: v0.6~31 X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=4263d925e02d97376367e9bb673832df035b8b6b;p=situare Bug fix for Login e-mail field is not pre-filled after failed login attempt Reviewed by: Kaj Wallin --- diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index bd06d4b..267cb41 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -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))); diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 6b453d7..c412071 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -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; diff --git a/src/ui/mainwindow.h b/src/ui/mainwindow.h index 8185c55..55df773 100644 --- a/src/ui/mainwindow.h +++ b/src/ui/mainwindow.h @@ -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