X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Ffacebookservice%2Ffacebookauthentication.cpp;fp=src%2Ffacebookservice%2Ffacebookauthentication.cpp;h=40f43098828659de3cd95885c92e00af22667f55;hb=2725fabd468bd70b4f978b957eca14a817d331d3;hp=ca8ac046905f72cbc54f81d852d478756f1f8c0e;hpb=b396ac0d5cc4daa2a6207115e16285579bf17b99;p=situare diff --git a/src/facebookservice/facebookauthentication.cpp b/src/facebookservice/facebookauthentication.cpp index ca8ac04..40f4309 100644 --- a/src/facebookservice/facebookauthentication.cpp +++ b/src/facebookservice/facebookauthentication.cpp @@ -58,6 +58,7 @@ void FacebookAuthentication::browserDestroyed() { qWarning() << __PRETTY_FUNCTION__; + m_mainWindow->toggleProgressIndicator(false); m_browser = 0; } @@ -79,6 +80,14 @@ void FacebookAuthentication::clearAccountInformation(bool keepUsername) NetworkCookieJar::clearCookiesSetting(); } +void FacebookAuthentication::destroyLogin() +{ + qWarning() << __PRETTY_FUNCTION__; + + m_mainWindow->destroyLoginDialog(); + m_browser->deleteLater(); +} + void FacebookAuthentication::loadFinished(bool ok) { qWarning() << __PRETTY_FUNCTION__ << ok; @@ -122,6 +131,8 @@ void FacebookAuthentication::login() url.append("req_perms=publish_stream"); m_browser->load(QUrl(url)); + + m_mainWindow->toggleProgressIndicator(true); } } @@ -131,6 +142,7 @@ void FacebookAuthentication::networkReplyHandler(QNetworkReply *reply) if (reply->error() != QNetworkReply::NoError) { qCritical() << __PRETTY_FUNCTION__ << "error:" << reply->error() << reply->errorString(); + destroyLogin(); /// @todo Emit error signal } } @@ -176,8 +188,7 @@ void FacebookAuthentication::urlChanged(const QUrl &url) const QString session = parseSession(url); qWarning() << __PRETTY_FUNCTION__ << "login finished, parsed session:" << session; if (!session.isEmpty()) { - m_mainWindow->destroyLoginDialog(); - m_browser->deleteLater(); + destroyLogin(); emit loggedIn(session); } }