diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-11-16 15:36:10 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-03-09 12:41:57 -0700 |
commit | 89047b3541618383ab5b39eeadff7dfcb60e1295 (patch) | |
tree | a97c1c1abda708998acfd85127915bf1b2b20a4e /core/gpslocation.cpp | |
parent | 5808a57e480d805e981c5f35c486114863c17da4 (diff) | |
download | subsurface-89047b3541618383ab5b39eeadff7dfcb60e1295.tar.gz |
GPS fixes: split collecting GPS fixes into own function
This finishes the spliting of the GPS fix application:
One function for collecting the fixes, one for application.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/gpslocation.cpp')
-rw-r--r-- | core/gpslocation.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/core/gpslocation.cpp b/core/gpslocation.cpp index dccfeb3b2..3f4fb887d 100644 --- a/core/gpslocation.cpp +++ b/core/gpslocation.cpp @@ -218,15 +218,14 @@ int GpsLocation::getGpsNum() const last = _mark; \ } -int GpsLocation::applyLocations() +std::vector<DiveAndLocation> GpsLocation::getLocations() { int i; int last = 0; int cnt = m_trackers.count(); - if (cnt == 0) - return false; - std::vector<DiveAndLocation> fixes; + if (cnt == 0) + return fixes; // create a table with the GPS information QList<struct gpsTracker> gpsTable = m_trackers.values(); @@ -308,6 +307,12 @@ int GpsLocation::applyLocations() } } + return fixes; +} + +int GpsLocation::applyLocations() +{ + std::vector<DiveAndLocation> fixes = getLocations(); for (DiveAndLocation &dl: fixes) { struct dive_site *ds = dl.d->dive_site; if (!ds) { |