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 --- core/gpslocation.cpp | 17 ----------------- core/gpslocation.h | 1 - 2 files changed, 18 deletions(-) (limited to 'core') diff --git a/core/gpslocation.cpp b/core/gpslocation.cpp index 3f4fb887d..e4a9b5185 100644 --- a/core/gpslocation.cpp +++ b/core/gpslocation.cpp @@ -310,23 +310,6 @@ std::vector GpsLocation::getLocations() return fixes; } -int GpsLocation::applyLocations() -{ - std::vector fixes = getLocations(); - for (DiveAndLocation &dl: fixes) { - struct dive_site *ds = dl.d->dive_site; - if (!ds) { - ds = create_dive_site(qPrintable(dl.name), &dive_site_table); - add_dive_to_dive_site(dl.d, ds); - invalidate_dive_cache(dl.d); - } - ds->location = dl.location; - } - if (!fixes.empty()) - mark_divelist_changed(true); - return !fixes.empty(); -} - QMap GpsLocation::currentGPSInfo() const { return m_trackers; diff --git a/core/gpslocation.h b/core/gpslocation.h index 2e8f92b26..4cc7f200c 100644 --- a/core/gpslocation.h +++ b/core/gpslocation.h @@ -34,7 +34,6 @@ public: static GpsLocation *instance(); static bool hasInstance(); std::vector getLocations(); - int applyLocations(); int getGpsNum() const; bool hasLocationsSource(); QString currentPosition(); -- cgit v1.2.3-70-g09d2