summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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()