summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2019-01-22 09:03:09 +0100
committerOliver Wolff <oliver.wolff@qt.io>2019-01-31 12:51:13 +0000
commitdc384a2376a13ae2a8776ea0eda7d6e2fd088a64 (patch)
tree9140fdd122b57d2089725ac3a7b89700358d9f2c
parent34e7bd9bda35783d466dc4dd3cf6157a186f6295 (diff)
downloadqtlocation-dc384a2376a13ae2a8776ea0eda7d6e2fd088a64.tar.gz
winrt: Remove incorrect asserts and fix incorrect condition
setPreferredPositioningMethods and setUpdateInterval are called by init so these functions should not assert in initializing state. Additionally the early exit condition in setPreferredPositioningMethods has to be the same as in setUpdateInterval. Both cases have to return early if the locator has not been initialized. This initialization happens in init, so both states, Initializing and Initialized, are fine for further handling. Change-Id: I4ef8db7178c38299328041a8d163a1b9bbecc5b1 Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Miguel Costa <miguel.costa@qt.io>
-rw-r--r--src/plugins/position/winrt/qgeopositioninfosource_winrt.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/plugins/position/winrt/qgeopositioninfosource_winrt.cpp b/src/plugins/position/winrt/qgeopositioninfosource_winrt.cpp
index fe783bd2..821d2e9f 100644
--- a/src/plugins/position/winrt/qgeopositioninfosource_winrt.cpp
+++ b/src/plugins/position/winrt/qgeopositioninfosource_winrt.cpp
@@ -226,11 +226,10 @@ void QGeoPositionInfoSourceWinRT::setPreferredPositioningMethods(QGeoPositionInf
PositioningMethods previousPreferredPositioningMethods = preferredPositioningMethods();
QGeoPositionInfoSource::setPreferredPositioningMethods(methods);
if (previousPreferredPositioningMethods == preferredPositioningMethods()
- || d->initState != InitializationState::Uninitialized) {
+ || d->initState == InitializationState::Uninitialized) {
return;
}
- Q_ASSERT(d->initState != InitializationState::Initializing);
const bool needsRestart = d->positionToken.value != 0 || d->statusToken.value != 0;
if (needsRestart)
@@ -257,7 +256,6 @@ void QGeoPositionInfoSourceWinRT::setUpdateInterval(int msec)
return;
}
- Q_ASSERT(d->initState != InitializationState::Initializing);
// minimumUpdateInterval is initialized to the lowest possible update interval in init().
// Passing 0 will cause an error on Windows 10.
// See https://docs.microsoft.com/en-us/uwp/api/windows.devices.geolocation.geolocator.reportinterval