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>
This commit is contained in:
Dirk Hohndel 2015-11-18 18:56:50 -08:00
parent ff5bd062f6
commit ca5b751610
2 changed files with 6 additions and 0 deletions

View file

@ -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) {

View file

@ -17,6 +17,7 @@ public:
bool applyLocations();
int getGpsNum() const;
QString getUserid(QString user, QString passwd);
bool hasLocationsSource();
private:
QGeoPositionInfo lastPos;