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>
This commit is contained in:
Dirk Hohndel 2015-11-11 12:34:56 -08:00
parent a29e74e2e9
commit cd7d6ae6e5
5 changed files with 46 additions and 0 deletions

View file

@ -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");