be compatible with qt 4.6/4.5
[googlelatitude] / src / glatitude.cpp
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;
-    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 ( QDateTime::currentMSecsSinceEpoch() < lastupdate + interval*1000 ) return;
+    if ( QDateTime::currentDateTime().toUTC().toTime_t() < lastupdate + interval ) return;
     worker->get(QNetworkRequest(urllogin));
 }
 
@@ -82,8 +82,8 @@ void GoogleLatitude::finishedreply(QNetworkReply *r) {
             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 {