Work in progress: hacks at vienna, do not use it
[googlelatitude] / liblatitudeupdater / googlelatitude.cpp
index d111370..6312633 100644 (file)
@@ -144,6 +144,16 @@ bool GoogleLatitude::getAutoConnect() {
     return OauthSettings.value("net_auto", true).toBool();
 }
 
+void GoogleLatitude::setDaemonMode(bool status) {
+    qDebug() << "* GoogleLatitude::setDaemonMode" << status;
+    OauthSettings.setValue("daemon", status);
+}
+
+bool GoogleLatitude::getDaemonMode() {
+    qDebug() << "* GoogleLatitude::getDaemonMode";
+    return OauthSettings.value("daemon", true).toBool();
+}
+
 void GoogleLatitude::onTemporaryTokenReceived(QString temporaryToken, QString temporaryTokenSecret) {
     qDebug() << "* GoogleLatitude::onTemporaryTokenReceived" << temporaryToken << temporaryTokenSecret;
     if( OauthManager->lastError() == KQOAuthManager::NoError) {
@@ -171,8 +181,10 @@ void GoogleLatitude::onAccessTokenReceived(QString token, QString tokenSecret) {
 void GoogleLatitude::onRequestReady(QByteArray response) {
     qDebug() << "* GoogleLatitude::onRequestReady" << response;
     if (response.contains("Invalid Credentials") ) {
+        qDebug() << "* GoogleLatitude::onRequestReady" << "Invalid Credentials";
         OauthSettings.remove("oauth_token");
         OauthSettings.remove("oauth_token_secret");
+        UserAuthorization.clear();
         emit notToken();
     }
 }