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>
This commit is contained in:
Berthold Stoeger 2019-11-16 21:44:57 +01:00 committed by Dirk Hohndel
parent 93bdaa9bb5
commit c8ec2f5b1c
3 changed files with 5 additions and 23 deletions

View file

@ -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()