No error set on PositionSource when couldn't fetch location

Bug #1488811 reported by Didier Roche-Tolomelli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
location-service (Ubuntu)
New
Undecided
Unassigned

Bug Description

PositionSource, when used on the phone (OTA5), didn't set the right sourceError on its object.
run the snippet below, deny location permission on that application

1. see that onPositionChanged event is fired, with "QGeoCoordinate(nan, nan,nan)" for positionSource.position.coordinate. However, if you read the documentation:
"However, whenever a positionChanged signal has been received, at least position::coordinate::latitude, position::coordinate::longitude, and position::timestamp can be assumed to be valid."

So, this forces the developer to add an extra positionSource.position.coordinate.isValid check. The event shouldn't be fired to respect the documentation

2. sourceError is always PositionSource.NoError (as if the location was permitted). It should rather be, from the documentation PositionSource.AccessError.

--------------

snippet:

import QtPositioning 5.2
import QtLocation 5.3

PositionSource {
    id: pos
    active: true
    updateInterval: 120000 // 2 mins
    onPositionChanged: {
        console.log("error value: " + pos.sourceError)
        console.log("coordinates " + positionSource.position.coordinate);
    }
}

Tags: devexp
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.