summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorTamás Martinec <tamas.martinec@symbio.com>2021-09-17 15:34:32 +0300
committerTamás Martinec <tamas.martinec@symbio.com>2021-09-22 09:59:41 +0300
commite0c154b8d613a4da6dc9971b1c9b80c8a24615eb (patch)
tree6bc8a026baf1231094e237770cab65c624d477e9 /examples
parent235446670bca809928bca635c6073e3cf90a9c11 (diff)
downloadqtlocation-e0c154b8d613a4da6dc9971b1c9b80c8a24615eb.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 Pick-to: 6.2 Change-Id: I62acc61bfd1318fc0c91ae2dbba4915ca5029275 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'examples')
-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()