diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2021-01-27 15:40:17 +0100 |
---|---|---|
committer | Ivan Solovev <ivan.solovev@qt.io> | 2021-01-29 10:40:46 +0100 |
commit | 26b53660fc916c543759e7add964ab696582120a (patch) | |
tree | 98f3de6180609447a4a7b14362aa3031b4b496ab /src/plugins/position/gypsy | |
parent | a8496e8d52e261a5a9206c4963adf43f6083de9e (diff) | |
download | qtlocation-26b53660fc916c543759e7add964ab696582120a.tar.gz |
QtPositioning: reset errors properly
Calling startUpdates(), startMonitoring() or requestUpdate() on
QGeoPositionInfoSource/QGeoSatelliteInfoSource/QGeoAreaMonitorSource
subclasses effectively means starting a new work session, which means
that we should not care about the previous errors. This patch resets
the errors to Error::NoError in all subclasses when calling these
methods.
Task-number: QTBUG-90491
Change-Id: Ia9cf0345e8c672d47814d8d0a865cd23541af61a
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/plugins/position/gypsy')
-rw-r--r-- | src/plugins/position/gypsy/qgeosatelliteinfosource_gypsy.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/position/gypsy/qgeosatelliteinfosource_gypsy.cpp b/src/plugins/position/gypsy/qgeosatelliteinfosource_gypsy.cpp index 6b1b430a..1c588916 100644 --- a/src/plugins/position/gypsy/qgeosatelliteinfosource_gypsy.cpp +++ b/src/plugins/position/gypsy/qgeosatelliteinfosource_gypsy.cpp @@ -298,6 +298,9 @@ void QGeoSatelliteInfoSourceGypsy::startUpdates() { if (m_updatesOngoing) return; + + m_error = QGeoSatelliteInfoSource::NoError; + // If there is a request timer ongoing, we've connected to the signal already if (!m_requestTimer.isActive()) { m_engine->eng_g_signal_connect (m_satellite, "satellites-changed", @@ -322,6 +325,9 @@ void QGeoSatelliteInfoSourceGypsy::requestUpdate(int timeout) { if (m_requestOngoing) return; + + m_error = QGeoSatelliteInfoSource::NoError; + if (timeout < 0) { setError(QGeoSatelliteInfoSource::UpdateTimeoutError); return; |