diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2018-04-14 11:12:07 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-04-14 13:37:44 -0700 |
commit | 1d95cc4cbfb229c55580b46512c9df1c5016247e (patch) | |
tree | d517960d69d62c706578894d26785d3d1102012d /mobile-widgets/qmlmanager.cpp | |
parent | ca3be8f376784cedbcf9c2bf8b11d2764f82036e (diff) | |
download | subsurface-1d95cc4cbfb229c55580b46512c9df1c5016247e.tar.gz |
QML UI: if we don't have a current position, update it later
Once we get a new fix we asynchronously update the text.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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() |