Modified automatic location update feature.
authorJussi Laitinen <jupe@l3l7588.ixonos.local>
Wed, 9 Jun 2010 12:32:07 +0000 (15:32 +0300)
committerJussi Laitinen <jupe@l3l7588.ixonos.local>
Wed, 9 Jun 2010 12:32:07 +0000 (15:32 +0300)
Reviewed by: Henri Lampela

src/engine/engine.cpp

index 0b749bf..224bc65 100644 (file)
@@ -176,8 +176,6 @@ void SituareEngine::enableAutomaticLocationUpdate(bool enabled, int updateInterv
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    bool accepted = true;
-
     m_automaticUpdateEnabled = enabled;
 
     //Show automatic update confirmation dialog
@@ -186,12 +184,9 @@ void SituareEngine::enableAutomaticLocationUpdate(bool enabled, int updateInterv
                 tr("Do you want to enable automatic location update with %1 min update interval?")
                 .arg(updateIntervalMsecs/1000/60));
         m_automaticUpdateFirstStart = false;
-    }
-    else {
-        if (!m_automaticUpdateFirstStart && m_automaticUpdateEnabled && accepted)
+    } else {
+        if (m_automaticUpdateEnabled && m_gps->isRunning()) {
             m_ui->buildInformationBox(tr("Automatic location update enabled"));
-
-        if (accepted && m_gps->isRunning() && m_automaticUpdateEnabled) {
             if (updateIntervalMsecs < MIN_UPDATE_INTERVAL_MSECS)
                 m_automaticUpdateIntervalTimer->setInterval(MIN_UPDATE_INTERVAL_MSECS);
             else
@@ -279,7 +274,7 @@ void SituareEngine::loginActionPressed()
 
 void SituareEngine::loginOk()
 {
-    qWarning() << __PRETTY_FUNCTION__;
+    qDebug() << __PRETTY_FUNCTION__;
 
     m_loggedIn = true;
     m_ui->loggedIn(m_loggedIn);
@@ -306,6 +301,8 @@ void SituareEngine::logout()
     m_loggedIn = false;
     m_ui->loggedIn(m_loggedIn);
     m_facebookAuthenticator->clearAccountInformation(); // clear all
+    m_automaticUpdateEnabled = false;
+    m_automaticUpdateFirstStart = true;
 }
 
 void SituareEngine::refreshUserData()