diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | core/gpslocation.cpp | 7 | ||||
-rw-r--r-- | mobile-widgets/qml/DiveDetailsEdit.qml | 1 |
3 files changed, 5 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 52718ab07..ab1af0b46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - undo: reset dive-mode on undo of set-point addition - desktop: complete rewrite of the statistics code, significantly expanding capabilities - desktop: add preferences option to disable default cylinder types +- mobile: fix broken 'use current location' in dive edit - mobile: add ability to show fundamentally the same statistics as on the desktop - mobile: add settings for DC and calculated ceilings and show calculated ceilings - mobile: switch to newer version of Kirigami diff --git a/core/gpslocation.cpp b/core/gpslocation.cpp index 1da12fe5b..012b24403 100644 --- a/core/gpslocation.cpp +++ b/core/gpslocation.cpp @@ -126,7 +126,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()); + 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; @@ -168,14 +168,13 @@ void GpsLocation::newPosition(QGeoPositionInfo pos) lastCoord.distanceTo(pos.coordinate()) > prefs.distance_threshold) { QString msg = QStringLiteral("received new position %1 after delta %2 threshold %3 (now %4 last %5)"); status(qPrintable(msg.arg(pos.coordinate().toString()).arg(delta).arg(prefs.time_threshold).arg(pos.timestamp().toString()).arg(timestampToDateTime(lastTime).toString()))); - waitingForPosition = false; - acquiredPosition(); gpsTracker gt; gt.when = thisTime; gt.location = create_location(pos.coordinate().latitude(), pos.coordinate().longitude()); addFixToStorage(gt); gpsTracker gtNew = m_trackers.last(); - qDebug() << "newest fix is now at" << timestampToDateTime(gtNew.when - gettimezoneoffset()).toString(); + waitingForPosition = false; + acquiredPosition(); } } diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml b/mobile-widgets/qml/DiveDetailsEdit.qml index ededf8196..5fb2b2cde 100644 --- a/mobile-widgets/qml/DiveDetailsEdit.qml +++ b/mobile-widgets/qml/DiveDetailsEdit.qml @@ -204,6 +204,7 @@ Item { target: manager onWaitingForPositionChanged: { gpsText = manager.getCurrentPosition() + manager.appendTextToLog("received updated position info " + gpsText) } } |