summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/position/winrt/qgeopositioninfosource_winrt.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/position/winrt/qgeopositioninfosource_winrt.cpp b/src/plugins/position/winrt/qgeopositioninfosource_winrt.cpp
index 9616b1d8..fa537af7 100644
--- a/src/plugins/position/winrt/qgeopositioninfosource_winrt.cpp
+++ b/src/plugins/position/winrt/qgeopositioninfosource_winrt.cpp
@@ -266,6 +266,11 @@ void QGeoPositionInfoSourceWinRT::setUpdateInterval(int msec)
if (msec != 0 && msec < minimumUpdateInterval())
msec = minimumUpdateInterval();
+ const bool needsRestart = d->positionToken.value != 0;
+
+ if (needsRestart)
+ stopHandler();
+
HRESULT hr = d->locator->put_ReportInterval(msec);
if (FAILED(hr)) {
setError(QGeoPositionInfoSource::UnknownSourceError);
@@ -276,6 +281,9 @@ void QGeoPositionInfoSourceWinRT::setUpdateInterval(int msec)
d->periodicTimer.setInterval(qMax(msec, minimumUpdateInterval()));
QGeoPositionInfoSource::setUpdateInterval(msec);
+
+ if (needsRestart)
+ startHandler();
}
int QGeoPositionInfoSourceWinRT::minimumUpdateInterval() const