From c8ec2f5b1ccd72d9ed5036bf9ecfec3b5f90964b Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 16 Nov 2019 21:44:57 +0100 Subject: 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 Signed-off-by: Dirk Hohndel --- mobile-widgets/qmlmanager.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mobile-widgets/qmlmanager.cpp') 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 fixes = locationProvider->getLocations(); + Command::applyGPSFixes(fixes); + appendTextToLog(QString("Attached %1 GPS fixes").arg(fixes.size())); + if (fixes.size()) + changesNeedSaving(); } void QMLManager::populateGpsData() -- cgit v1.2.3-70-g09d2