summaryrefslogtreecommitdiffstats
path: root/subsurface-core/gpslocation.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-18 18:56:50 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-18 19:15:59 -0800
commitca5b751610e1928eb1211622035390bd38dd32bf (patch)
treeb9a02d9483f5188f379287f99740bc58a1e30c22 /subsurface-core/gpslocation.cpp
parentff5bd062f67e36a3eb20013e40e4e54822b446bf (diff)
downloadsubsurface-ca5b751610e1928eb1211622035390bd38dd32bf.tar.gz
Location service: check presence of location source
In theory this should only report a location service if this is a satellite based service, but sadly geoclue appears to claim that there is a satellite based service in my Linux VM - so I'm doubtful that this does what the documentation says it does. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core/gpslocation.cpp')
-rw-r--r--subsurface-core/gpslocation.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/subsurface-core/gpslocation.cpp b/subsurface-core/gpslocation.cpp
index 4c2879f7c..2445c604d 100644
--- a/subsurface-core/gpslocation.cpp
+++ b/subsurface-core/gpslocation.cpp
@@ -31,6 +31,11 @@ GpsLocation::GpsLocation(void (*showMsgCB)(const char *), QObject *parent)
userAgent = getUserAgent();
}
+bool GpsLocation::hasLocationsSource()
+{
+ return gpsSource != 0 && (gpsSource->supportedPositioningMethods() & QGeoPositionInfoSource::SatellitePositioningMethods);
+}
+
void GpsLocation::serviceEnable(bool toggle)
{
if (!gpsSource) {