be compatible with qt 4.6/4.5
authorRodrigo Linfati <rodrigo@linfati.cl>
Sat, 22 Jan 2011 20:20:57 +0000 (21:20 +0100)
committerRodrigo Linfati <rodrigo@linfati.cl>
Sat, 22 Jan 2011 20:20:57 +0000 (21:20 +0100)
src/glatitude.cpp
src/glatitude.h

index 0573772..2f9dcac 100644 (file)
@@ -41,10 +41,10 @@ void GoogleLatitude::set(double la, double lo, double ac) {
     accuracy = ac;
 
     qDebug() << "GoogleLatitude: set la = " << la << " lo = " << lo << " ac = " << ac;
     accuracy = ac;
 
     qDebug() << "GoogleLatitude: set la = " << la << " lo = " << lo << " ac = " << ac;
-    qDebug() << "GoogleLatitude: set lastupdate = " << lastupdate << " current = " << QDateTime::currentMSecsSinceEpoch();
+    qDebug() << "GoogleLatitude: set lastupdate = " << lastupdate << " current = " << QDateTime::currentDateTime().toUTC().toTime_t();
     if (login_error) return;
     if (la*lo == 0) return;
     if (login_error) return;
     if (la*lo == 0) return;
-    if ( QDateTime::currentMSecsSinceEpoch() < lastupdate + interval*1000 ) return;
+    if ( QDateTime::currentDateTime().toUTC().toTime_t() < lastupdate + interval ) return;
     worker->get(QNetworkRequest(urllogin));
 }
 
     worker->get(QNetworkRequest(urllogin));
 }
 
@@ -82,8 +82,8 @@ void GoogleLatitude::finishedreply(QNetworkReply *r) {
             login_error = true;
             emit ERROR();
         } else {
             login_error = true;
             emit ERROR();
         } else {
-            lastupdate = QDateTime::currentMSecsSinceEpoch();
-            qDebug() << "GoogleLatitude: update ok " << " lastupdate = " << lastupdate;
+            lastupdate = QDateTime::currentDateTime().toUTC().toTime_t();
+            qDebug() << "GoogleLatitude: update ok " << "lastupdate = " << lastupdate;
             emit OK();
         }
     } else {
             emit OK();
         }
     } else {
index da1413a..498b454 100644 (file)
@@ -36,7 +36,7 @@ private:
     QUrl urllogin;
     QUrl urldologin;
     QUrl urlupdate;
     QUrl urllogin;
     QUrl urldologin;
     QUrl urlupdate;
-    qint64 lastupdate;
+    unsigned int lastupdate;
     bool login_error;
 };
 
     bool login_error;
 };