mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
5808a57e48
commit
89047b3541
2 changed files with 10 additions and 4 deletions
|
@ -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) {
|
||||
|
|
|
@ -33,6 +33,7 @@ public:
|
|||
~GpsLocation();
|
||||
static GpsLocation *instance();
|
||||
static bool hasInstance();
|
||||
std::vector<DiveAndLocation> getLocations();
|
||||
int applyLocations();
|
||||
int getGpsNum() const;
|
||||
bool hasLocationsSource();
|
||||
|
|
Loading…
Add table
Reference in a new issue