mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
9d2449c5c3
commit
7acb229b4a
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue