diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml b/mobile-widgets/qml/DiveDetailsEdit.qml index 25c33b939..ef5d304d3 100644 --- a/mobile-widgets/qml/DiveDetailsEdit.qml +++ b/mobile-widgets/qml/DiveDetailsEdit.qml @@ -177,6 +177,12 @@ Item { gpsText = manager.getCurrentPosition() } } + Connections { + target: manager + onWaitingForPositionChanged: { + gpsText = manager.getCurrentPosition() + } + } Controls.Label { Layout.alignment: Qt.AlignRight diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index c2b2b66fd..a9c855eab 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -1297,7 +1297,12 @@ QString QMLManager::getCurrentPosition() if (!hasLocationSource) return tr("Unknown GPS location"); - return locationProvider->currentPosition(); + QString positionResponse = locationProvider->currentPosition(); + if (positionResponse == GPS_CURRENT_POS) + connect(locationProvider, &GpsLocation::acquiredPosition, this, &QMLManager::waitingForPositionChanged, Qt::UniqueConnection); + else + disconnect(locationProvider, &GpsLocation::acquiredPosition, this, &QMLManager::waitingForPositionChanged); + return positionResponse; } void QMLManager::applyGpsData() diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h index dd3d48dff..b158e43ee 100644 --- a/mobile-widgets/qmlmanager.h +++ b/mobile-widgets/qmlmanager.h @@ -280,6 +280,7 @@ signals: void buddyListChanged(); void divemasterListChanged(); void locationListChanged(); + void waitingForPositionChanged(); }; #endif