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>
This commit is contained in:
Berthold Stoeger 2019-11-16 15:36:10 +01:00 committed by Dirk Hohndel
parent 5808a57e48
commit 89047b3541
2 changed files with 10 additions and 4 deletions

View file

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

View file

@ -33,6 +33,7 @@ public:
~GpsLocation();
static GpsLocation *instance();
static bool hasInstance();
std::vector<DiveAndLocation> getLocations();
int applyLocations();
int getGpsNum() const;
bool hasLocationsSource();