From 5a837906fe9cee9952da7c38e0987857b214d63d Mon Sep 17 00:00:00 2001 From: Rodrigo Linfati Date: Sat, 22 Jan 2011 21:20:57 +0100 Subject: [PATCH] be compatible with qt 4.6/4.5 --- src/glatitude.cpp | 8 ++++---- src/glatitude.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/glatitude.cpp b/src/glatitude.cpp index 0573772..2f9dcac 100644 --- a/src/glatitude.cpp +++ b/src/glatitude.cpp @@ -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 { diff --git a/src/glatitude.h b/src/glatitude.h index da1413a..498b454 100644 --- a/src/glatitude.h +++ b/src/glatitude.h @@ -36,7 +36,7 @@ private: QUrl urllogin; QUrl urldologin; QUrl urlupdate; - qint64 lastupdate; + unsigned int lastupdate; bool login_error; }; -- 1.7.9.5