Updated error handling, added error contexts. Fixed fullscreen button
[situare] / src / facebookservice / facebookauthentication.cpp
index 716b054..f69d167 100644 (file)
@@ -131,7 +131,7 @@ bool FacebookAuthentication::updateCredentials(const QUrl &url)
                         QVariantMap result = parser.parse (jsonString, &ok).toMap();
 
                         if (!ok) {
-                            emit error(SituareError::INVALID_JSON);
+                            emit error(ErrorContext::SITUARE, SituareError::INVALID_JSON);
                             found = false;
                         } else {
                             qDebug() << "Session Key" << result[SESSION_KEY].toString();
@@ -168,22 +168,22 @@ bool FacebookAuthentication::updateCredentials(const QUrl &url)
             qDebug() << callbackUrl;
             clearAccountInformation(true);
             if(m_freshLogin) {
-                emit error(SituareError::LOGIN_FAILED);
+                emit error(ErrorContext::SITUARE, SituareError::LOGIN_FAILED);
             } else {
                 m_freshLogin = true;
-                emit error(SituareError::SESSION_EXPIRED);
+                emit error(ErrorContext::SITUARE, SituareError::SESSION_EXPIRED);
             }
         } else if(callbackUrl.indexOf(LOGIN_PAGE) == 0) {
             qDebug() << "correct loginPage";
         } else {
             qDebug() << "totally wrong webPage";
             // we should not get a wrong page at this point
-            emit error(SituareError::LOGIN_FAILED);
+            emit error(ErrorContext::SITUARE, SituareError::LOGIN_FAILED);
         }
     } else {
         qDebug() << " Loading of page failed invalid URL" << endl;
         // we should not get a wrong page at this point
-        emit error(SituareError::LOGIN_FAILED);
+        emit error(ErrorContext::SITUARE, SituareError::LOGIN_FAILED);
     }
     return found;
 }