summaryrefslogtreecommitdiffstats
path: root/core/gpslocation.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-07-11 11:57:50 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-07-11 11:57:54 -0700
commit7acb229b4a8876ab0b679521afa44fa74d4433dc (patch)
tree42a0df5692f4d5e42ea0f8a1caffb764071d5a3f /core/gpslocation.cpp
parent9d2449c5c302a67044f4a7d6802a38bafa477ecc (diff)
downloadsubsurface-7acb229b4a8876ab0b679521afa44fa74d4433dc.tar.gz
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>
Diffstat (limited to 'core/gpslocation.cpp')
-rw-r--r--core/gpslocation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/gpslocation.cpp b/core/gpslocation.cpp
index 2d63b42f5..e7a4b5d8f 100644
--- a/core/gpslocation.cpp
+++ b/core/gpslocation.cpp
@@ -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;