aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-11-16 21:44:57 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-09 12:41:57 -0700
commitc8ec2f5b1ccd72d9ed5036bf9ecfec3b5f90964b (patch)
tree48b096b31a804aa55d3d8db30522e8e1ae681f7c /mobile-widgets
parent93bdaa9bb5be80115dc80af569a2c64e0136c5f5 (diff)
downloadsubsurface-c8ec2f5b1ccd72d9ed5036bf9ecfec3b5f90964b.tar.gz
mobile: use undo-command to apply gps fixes
The goal is to send the signal for the correct dives / divesites and thus not having to reload the whole model. Right now the mobile UI does not yet catch the diveSiteChanged signals. [Dirk Hohndel: small fix to ensure that we trigger a save to storage] Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qmlmanager.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 6243bc3ea..3cc8ed0c5 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -1572,11 +1572,11 @@ QString QMLManager::getCurrentPosition()
void QMLManager::applyGpsData()
{
appendTextToLog("Applying GPS fiexs");
- int cnt = locationProvider->applyLocations();
- if (cnt == 0)
- return;
- appendTextToLog(QString("Attached %1 GPS fixes").arg(cnt));
- refreshDiveList();
+ std::vector<DiveAndLocation> fixes = locationProvider->getLocations();
+ Command::applyGPSFixes(fixes);
+ appendTextToLog(QString("Attached %1 GPS fixes").arg(fixes.size()));
+ if (fixes.size())
+ changesNeedSaving();
}
void QMLManager::populateGpsData()