From 4f10f7f7ae9b791f08cf97ec64f9a8a0468145c2 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 10 Jan 2016 19:34:21 -0800 Subject: QML UI: refresh divelist after GPS data was successfully applied And create a helper to do so to make the code simpler. Signed-off-by: Dirk Hohndel --- subsurface-core/gpslocation.cpp | 5 +++-- subsurface-core/gpslocation.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'subsurface-core') diff --git a/subsurface-core/gpslocation.cpp b/subsurface-core/gpslocation.cpp index 361a1b23c..e5f38dc1d 100644 --- a/subsurface-core/gpslocation.cpp +++ b/subsurface-core/gpslocation.cpp @@ -208,14 +208,14 @@ static void copy_gps_location(struct gpsTracker &gps, struct dive *d) } #define SAME_GROUP 6 * 3600 /* six hours */ -void GpsLocation::applyLocations() +bool GpsLocation::applyLocations() { int i; bool changed = false; int last = 0; int cnt = m_trackers.count(); if (cnt == 0) - return; + return false; // create a table with the GPS information QList gpsTable = m_trackers.values(); @@ -317,6 +317,7 @@ void GpsLocation::applyLocations() } if (changed) mark_divelist_changed(true); + return changed; } QMap GpsLocation::currentGPSInfo() const diff --git a/subsurface-core/gpslocation.h b/subsurface-core/gpslocation.h index 20ed26ed9..0e183d9f8 100644 --- a/subsurface-core/gpslocation.h +++ b/subsurface-core/gpslocation.h @@ -25,7 +25,7 @@ public: GpsLocation(void (*showMsgCB)(const char *msg), QObject *parent); ~GpsLocation(); static GpsLocation *instance(); - void applyLocations(); + bool applyLocations(); int getGpsNum() const; QString getUserid(QString user, QString passwd); bool hasLocationsSource(); -- cgit v1.2.3-70-g09d2