diff options
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeocodemodel.cpp')
-rw-r--r-- | src/location/declarativemaps/qdeclarativegeocodemodel.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeocodemodel.cpp b/src/location/declarativemaps/qdeclarativegeocodemodel.cpp index b64b2545..9a9a2555 100644 --- a/src/location/declarativemaps/qdeclarativegeocodemodel.cpp +++ b/src/location/declarativemaps/qdeclarativegeocodemodel.cpp @@ -385,12 +385,13 @@ void QDeclarativeGeocodeModel::geocodeFinished(QGeoCodeReply *reply) { if (reply != reply_ || reply->error() != QGeoCodeReply::NoError) return; + + reply->deleteLater(); + reply_ = 0; int oldCount = declarativeLocations_.count(); setLocations(reply->locations()); setError(NoError, QString()); setStatus(QDeclarativeGeocodeModel::Ready); - reply->deleteLater(); - reply_ = 0; emit locationsChanged(); if (oldCount != declarativeLocations_.count()) emit countChanged(); @@ -405,7 +406,9 @@ void QDeclarativeGeocodeModel::geocodeError(QGeoCodeReply *reply, { if (reply != reply_) return; - Q_UNUSED(error); + + reply->deleteLater(); + reply_ = 0; int oldCount = declarativeLocations_.count(); if (oldCount > 0) { // Reset the model @@ -415,8 +418,6 @@ void QDeclarativeGeocodeModel::geocodeError(QGeoCodeReply *reply, } setError(static_cast<QDeclarativeGeocodeModel::GeocodeError>(error), errorString); setStatus(QDeclarativeGeocodeModel::Error); - reply->deleteLater(); - reply_ = 0; } /*! |