mobile/location-service: stop using broken adjustment function

gettimezoneoffset() returns incorrect values when called with a time_t.
Since we only accept the value here if it is within 5 minutes of 'now',
using the current timezone offset is a fair approximation.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-07-11 11:57:50 -07:00
parent 9d2449c5c3
commit 7acb229b4a

View file

@ -133,7 +133,7 @@ QString GpsLocation::currentPosition()
if (!hasLocationsSource())
return tr("Unknown GPS location (no GPS source)");
if (m_trackers.count()) {
QDateTime lastFixTime = timestampToDateTime(m_trackers.lastKey() - gettimezoneoffset(m_trackers.lastKey()));
QDateTime lastFixTime = timestampToDateTime(m_trackers.lastKey() + gettimezoneoffset());
QDateTime now = QDateTime::currentDateTime();
int delta = lastFixTime.secsTo(now);
qDebug() << "lastFixTime" << lastFixTime.toString() << "now" << now.toString() << "delta" << delta;