summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamás Martinec <tamas.martinec@symbio.com>2021-09-17 15:34:32 +0300
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-22 08:38:43 +0000
commit0af6ce9a7515fa0ddea2891ec15a9b66c037cec6 (patch)
tree58bd679b7c6f4efded356935f0cc6de4dbf03bc1
parent3cf879b515fcb628d83c918c36a8926363e66eaa (diff)
downloadqtlocation-0af6ce9a7515fa0ddea2891ec15a9b66c037cec6.tar.gz
QtLocation: Fix position not updating after accepting location dialog on macOS
Removed the deletion of the location manager if location authorization status is not known. Results in AppModel::positionError at the moment. This happens on macOS before the location authorization dialog is answered. Task-number: QTBUG-91534 Change-Id: I62acc61bfd1318fc0c91ae2dbba4915ca5029275 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit e0c154b8d613a4da6dc9971b1c9b80c8a24615eb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--examples/positioning/weatherinfo/appmodel.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/examples/positioning/weatherinfo/appmodel.cpp b/examples/positioning/weatherinfo/appmodel.cpp
index 09c6cfbb..a5f207f1 100644
--- a/examples/positioning/weatherinfo/appmodel.cpp
+++ b/examples/positioning/weatherinfo/appmodel.cpp
@@ -323,16 +323,14 @@ void AppModel::positionError(QGeoPositionInfoSource::Error e)
{
Q_UNUSED(e);
qWarning() << "Position source error. Falling back to simulation mode.";
- // cleanup insufficient QGeoPositionInfoSource instance
- d->src->stopUpdates();
- d->src->deleteLater();
- d->src = nullptr;
// activate simulation mode
- d->useGps = false;
- d->city = "Brisbane";
- emit cityChanged();
- requestWeatherByCity();
+ if (d->useGps) {
+ d->useGps = false;
+ d->city = "Brisbane";
+ emit cityChanged();
+ requestWeatherByCity();
+ }
}
void AppModel::refreshWeather()