Public bug reported:

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);
    }
}

** Affects: location-service (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: devexp

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1488811

Title:
  No error set on PositionSource when couldn't fetch location

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/location-service/+bug/1488811/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to