diff options
Diffstat (limited to 'subsurface-core/gpslocation.cpp')
-rw-r--r-- | subsurface-core/gpslocation.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/subsurface-core/gpslocation.cpp b/subsurface-core/gpslocation.cpp index 59cd97900..79fb9a088 100644 --- a/subsurface-core/gpslocation.cpp +++ b/subsurface-core/gpslocation.cpp @@ -327,33 +327,29 @@ void GpsLocation::applyLocations() mark_divelist_changed(true); } -#ifdef SUBSURFACE_MOBILE -void GpsLocation::updateModel() +QVector< gpsTracker > GpsLocation::currentGPSInfo() const { - GpsListModel *gpsListModel = GpsListModel::instance(); - if (!gpsListModel) { - qDebug() << "no gpsListModel"; - return; - } + QVector<gpsTracker> trackers; + int cnt = geoSettings->value("count", 0).toInt(); if (cnt == 0) { qDebug() << "no gps fixes"; - gpsListModel->clear(); - return; + return trackers; } // create a table with the GPS information + trackers.reserve(cnt); + struct gpsTracker gt; for (int i = 0; i < cnt; i++) { gt.latitude.udeg = geoSettings->value(QString("gpsFix%1_lat").arg(i)).toInt(); gt.longitude.udeg = geoSettings->value(QString("gpsFix%1_lon").arg(i)).toInt(); gt.when = geoSettings->value(QString("gpsFix%1_time").arg(i)).toULongLong(); gt.name = geoSettings->value(QString("gpsFix%1_name").arg(i)).toString(); - gpsListModel->addGpsFix(>); + trackers.append(gt); } - qDebug() << "added" << cnt << "gps fixes to model"; + return trackers; } -#endif void GpsLocation::clearGpsData() { |