summaryrefslogtreecommitdiff
path: root/src/plugins/position/winrt
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2019-01-03 10:45:00 +0100
committerAlex Blasche <alexander.blasche@qt.io>2019-01-04 14:12:25 +0000
commit81a9c22e75f37c8878d41fa2df249ae20bc44adb (patch)
treeba935ca77ab9fd2e7894d4fe898b846533c27a38 /src/plugins/position/winrt
parent420128331deef9dd963c9455cab6ef47a8f20a5c (diff)
downloadqtlocation-81a9c22e75f37c8878d41fa2df249ae20bc44adb.tar.gz
winrt: Minor improvements in error handling
- If more than 1 action is done inside runOnXamlThread any error should cause a "top level" error. - If every possible error inside runOnXamlThread gives a proper error message we do not need another error message outside of the block. Change-Id: I910f9e4bc7984e1c7e1f358eee975738ffa3bb2f Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/plugins/position/winrt')
-rw-r--r--src/plugins/position/winrt/qgeopositioninfosource_winrt.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/position/winrt/qgeopositioninfosource_winrt.cpp b/src/plugins/position/winrt/qgeopositioninfosource_winrt.cpp
index 139a6b3d..b55d2ba3 100644
--- a/src/plugins/position/winrt/qgeopositioninfosource_winrt.cpp
+++ b/src/plugins/position/winrt/qgeopositioninfosource_winrt.cpp
@@ -179,7 +179,6 @@ int QGeoPositionInfoSourceWinRT::init()
});
if (FAILED(hr)) {
setError(QGeoPositionInfoSource::UnknownSourceError);
- qErrnoWarning(hr, "Could not register status changed callback");
return -1;
}
@@ -342,15 +341,17 @@ bool QGeoPositionInfoSourceWinRT::startHandler()
// registered. That could have helped in the single update case
ComPtr<IAsyncOperation<Geoposition*>> op;
hr = d->locator->GetGeopositionAsync(&op);
+ RETURN_HR_IF_FAILED("Could not start position operation");
hr = d->locator->add_PositionChanged(Callback<GeoLocatorPositionHandler>(this,
&QGeoPositionInfoSourceWinRT::onPositionChanged).Get(),
&d->positionToken);
+ RETURN_HR_IF_FAILED("Could not add position handler");
+
return hr;
});
if (FAILED(hr)) {
setError(QGeoPositionInfoSource::UnknownSourceError);
- qErrnoWarning(hr, "Could not add position handler");
return false;
}