diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-01-09 08:22:49 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-01-09 08:22:59 +0100 |
commit | 9735cab006350ef9cb9a3f9b32b4829350bd1c6e (patch) | |
tree | b3d0d3e15bd7efb36d4b136fb0da73575a20995c /src/plugins/geoservices | |
parent | fd4a2493ca7b342b66fa08b6e26528754ed78198 (diff) | |
parent | c566e7bf49a6d329f9ef6bfbee59aca8365e78ef (diff) | |
download | qtlocation-9735cab006350ef9cb9a3f9b32b4829350bd1c6e.tar.gz |
Merge remote-tracking branch 'gerrit/5.4' into dev
Change-Id: I784619fd03371ec90e42b79dbb68afdda5dc5530
Diffstat (limited to 'src/plugins/geoservices')
-rw-r--r-- | src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp | 4 | ||||
-rw-r--r-- | src/plugins/geoservices/osm/qgeocodereplyosm.cpp | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp b/src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp index 7aaa6bd5..c4b04ece 100644 --- a/src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp +++ b/src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp @@ -71,8 +71,10 @@ QGeoCodeReplyNokia::~QGeoCodeReplyNokia() void QGeoCodeReplyNokia::abort() { - if (!m_reply && !m_parsing) + if (!m_reply) { + m_parsing = false; return; + } m_reply->abort(); diff --git a/src/plugins/geoservices/osm/qgeocodereplyosm.cpp b/src/plugins/geoservices/osm/qgeocodereplyosm.cpp index 6c880d2d..5823a179 100644 --- a/src/plugins/geoservices/osm/qgeocodereplyosm.cpp +++ b/src/plugins/geoservices/osm/qgeocodereplyosm.cpp @@ -79,6 +79,7 @@ void QGeoCodeReplyOsm::networkReplyFinished() if (m_reply->error() != QNetworkReply::NoError) return; + QList<QGeoLocation> locations; QJsonDocument document = QJsonDocument::fromJson(m_reply->readAll()); if (document.isObject()) { @@ -105,16 +106,12 @@ void QGeoCodeReplyOsm::networkReplyFinished() location.setCoordinate(coordinate); location.setAddress(address); - QList<QGeoLocation> locations; locations.append(location); setLocations(locations); - setFinished(true); } else if (document.isArray()) { QJsonArray results = document.array(); - QList<QGeoLocation> locations; - for (int i = 0; i < results.count(); ++i) { if (!results.at(i).isObject()) continue; @@ -157,10 +154,11 @@ void QGeoCodeReplyOsm::networkReplyFinished() locations.append(location); } - setLocations(locations); - setFinished(true); } + setLocations(locations); + setFinished(true); + m_reply->deleteLater(); m_reply = 0; } |