summaryrefslogtreecommitdiffstats
path: root/qt-mobile
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-12 13:04:23 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-12 13:04:23 -0800
commita8b0e9aa19a3c10b7ea1659bef18355c53049870 (patch)
tree7eb7a6658d91fe2648af4589f62c0e2e4c0c457a /qt-mobile
parent1b0938034e6bb6fb596f55aa4f3fc25c97289a7b (diff)
downloadsubsurface-a8b0e9aa19a3c10b7ea1659bef18355c53049870.tar.gz
Location service: move GPS data to separate QSettings instance
This way we don't clutter the main settings and we don't have to deal with making sure we are reading and writing from/to the right group. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile')
-rw-r--r--qt-mobile/gpslocation.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/qt-mobile/gpslocation.cpp b/qt-mobile/gpslocation.cpp
index d9132f28e..82d7ed0c1 100644
--- a/qt-mobile/gpslocation.cpp
+++ b/qt-mobile/gpslocation.cpp
@@ -8,7 +8,9 @@
GpsLocation::GpsLocation(QObject *parent)
{
- QSettings *geoSettings = new QSettings();
+ // create a QSettings object that's separate from the main application settings
+ QSettings *geoSettings = new QSettings(QSettings::NativeFormat, QSettings::UserScope,
+ QString("org.subsurfacedivelog"), QString("subsurfacelocation"), this);
gpsSource = QGeoPositionInfoSource::createDefaultSource(parent);
if (gpsSource != 0) {
QString msg = QString("have position source %1").arg(gpsSource->sourceName());
@@ -44,7 +46,6 @@ void GpsLocation::newPosition(QGeoPositionInfo pos)
QGeoCoordinate lastCoord;
QString msg("received new position %1");
status(qPrintable(msg.arg(pos.coordinate().toString())));
- geoSettings.beginGroup("locations");
int nr = geoSettings.value("count", 0).toInt();
if (nr) {
lastCoord.setLatitude(geoSettings.value(QString("gpsFix%1_lat").arg(nr)).toInt() / 1000000.0);