summaryrefslogtreecommitdiffstats
path: root/qt-mobile/gpslocation.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-11 12:34:56 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-11 15:28:10 -0800
commitcd7d6ae6e51a8422a141fc389b2eca232b7e93c5 (patch)
tree055252befcf672c1a1355329bc5e981f6b7ad988 /qt-mobile/gpslocation.cpp
parenta29e74e2e949696c4ffdefeedad22ae1795f024c (diff)
downloadsubsurface-cd7d6ae6e51a8422a141fc389b2eca232b7e93c5.tar.gz
Location service: toggle the service from the main menu
That way we don't track the user's location until explicitly asked to do so. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/gpslocation.cpp')
-rw-r--r--qt-mobile/gpslocation.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/qt-mobile/gpslocation.cpp b/qt-mobile/gpslocation.cpp
index fea313950..d1c5c4588 100644
--- a/qt-mobile/gpslocation.cpp
+++ b/qt-mobile/gpslocation.cpp
@@ -22,6 +22,21 @@ GpsLocation::GpsLocation(QObject *parent)
status("don't have GPS source");
}
}
+
+void GpsLocation::serviceEnable(bool toggle)
+{
+ if (!gpsSource)
+ return;
+
+ if (toggle) {
+ gpsSource->startUpdates();
+ status("Starting Subsurface GPS service");
+ } else {
+ gpsSource->stopUpdates();
+ status("Stopping Subsurface GPS service");
+ }
+}
+
void GpsLocation::newPosition(QGeoPositionInfo pos)
{
QString msg("received new position %1");