diff options
-rw-r--r-- | core/gpslocation.cpp | 8 | ||||
-rw-r--r-- | core/gpslocation.h | 2 | ||||
-rw-r--r-- | mobile-widgets/qml/main.qml | 4 | ||||
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 8 |
4 files changed, 15 insertions, 7 deletions
diff --git a/core/gpslocation.cpp b/core/gpslocation.cpp index 974b9636b..c12d0a1d1 100644 --- a/core/gpslocation.cpp +++ b/core/gpslocation.cpp @@ -225,14 +225,14 @@ static void copy_gps_location(struct gpsTracker &gps, struct dive *d) #define SET_LOCATION(_dive, _gpsfix, _mark) \ { \ copy_gps_location(_gpsfix, _dive); \ - changed = true; \ + changed++; \ last = _mark; \ } -bool GpsLocation::applyLocations() +int GpsLocation::applyLocations() { int i; - bool changed = false; + int changed = 0; int last = 0; int cnt = m_trackers.count(); if (cnt == 0) @@ -317,7 +317,7 @@ bool GpsLocation::applyLocations() } } - if (changed) + if (changed > 0) mark_divelist_changed(true); return changed; } diff --git a/core/gpslocation.h b/core/gpslocation.h index 02377bfca..0a333947b 100644 --- a/core/gpslocation.h +++ b/core/gpslocation.h @@ -27,7 +27,7 @@ public: ~GpsLocation(); static GpsLocation *instance(); static bool hasInstance(); - bool applyLocations(); + int applyLocations(); int getGpsNum() const; bool hasLocationsSource(); QString currentPosition(); diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 63c071766..cd8635b63 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -292,6 +292,10 @@ Kirigami.ApplicationWindow { globalDrawer.close() diveModel.resetInternalData() manager.refreshDiveList() + while (pageStack.depth > 1) { + pageStack.pop() + } + pageStack.push(diveList) } } Kirigami.Action { diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 42bb24f70..b69783e95 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -1577,8 +1577,12 @@ QString QMLManager::getCurrentPosition() void QMLManager::applyGpsData() { - if (locationProvider->applyLocations()) - refreshDiveList(); + appendTextToLog("Applying GPS fiexs"); + int cnt = locationProvider->applyLocations(); + if (cnt == 0) + return; + appendTextToLog(QString("Attached %1 GPS fixes").arg(cnt)); + refreshDiveList(); } void QMLManager::populateGpsData() |