mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Location service: Correctly access the last stored GPS fix
Now only storing fixes after a certain time / distance actually works. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d65b756c4f
commit
fcbc013cb4
1 changed files with 3 additions and 3 deletions
|
@ -51,9 +51,9 @@ void GpsLocation::newPosition(QGeoPositionInfo pos)
|
||||||
status(qPrintable(msg.arg(pos.coordinate().toString())));
|
status(qPrintable(msg.arg(pos.coordinate().toString())));
|
||||||
int nr = geoSettings->value("count", 0).toInt();
|
int nr = geoSettings->value("count", 0).toInt();
|
||||||
if (nr) {
|
if (nr) {
|
||||||
lastCoord.setLatitude(geoSettings->value(QString("gpsFix%1_lat").arg(nr)).toInt() / 1000000.0);
|
lastCoord.setLatitude(geoSettings->value(QString("gpsFix%1_lat").arg(nr - 1)).toInt() / 1000000.0);
|
||||||
lastCoord.setLongitude(geoSettings->value(QString("gpsFix%1_lon").arg(nr)).toInt() / 1000000.0);
|
lastCoord.setLongitude(geoSettings->value(QString("gpsFix%1_lon").arg(nr - 1)).toInt() / 1000000.0);
|
||||||
time_t lastTime = geoSettings->value(QString("gpsFix%1_time").arg(nr)).toULongLong();
|
lastTime = geoSettings->value(QString("gpsFix%1_time").arg(nr - 1)).toULongLong();
|
||||||
}
|
}
|
||||||
// if we have no record stored or if at least the configured minimum
|
// if we have no record stored or if at least the configured minimum
|
||||||
// time has passed or we moved at least the configured minimum distance
|
// time has passed or we moved at least the configured minimum distance
|
||||||
|
|
Loading…
Add table
Reference in a new issue