diff options
author | Alex Blasche <alexander.blasche@qt.io> | 2016-12-05 12:43:52 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@qt.io> | 2016-12-05 12:43:52 +0100 |
commit | 335116ea024f51e1693bba39f78e15131870f1b0 (patch) | |
tree | 148ccdb4703b4a35afb1b0e3875573b1eb90d0ce /src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp | |
parent | 5e4bc1fe908896e9b90e8ad9c3896f35b5ec37be (diff) | |
parent | ba9b7b9ef674d93680070f6c4bb1053d0d2325dd (diff) | |
download | qtlocation-335116ea024f51e1693bba39f78e15131870f1b0.tar.gz |
Merge remote-tracking branch 'gerrit/5.8' into dev
Conflicts:
src/imports/location/qdeclarativegeomap.cpp
src/location/maps/maps.pri
src/location/maps/qgeomap_p_p.h
src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp
src/plugins/geoservices/osm/qgeoroutereplyosm.cpp
Change-Id: I18d31cff9233648178fe3e2636ce294026dfaeb7
Diffstat (limited to 'src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp')
-rw-r--r-- | src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp b/src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp index 53a28652..0fb6eb2a 100644 --- a/src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp +++ b/src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp @@ -35,7 +35,7 @@ ****************************************************************************/ #include "qgeocodereply_nokia.h" -#include "qgeocodexmlparser.h" +#include "qgeocodejsonparser.h" #include "qgeoerror_messages.h" #include <QtPositioning/QGeoShape> @@ -45,9 +45,15 @@ Q_DECLARE_METATYPE(QList<QGeoLocation>) QT_BEGIN_NAMESPACE +// manualBoundsRequired will be true if the parser has to manually +// check if a given result lies within the viewport bounds, +// and false if the bounds information was able to be supplied +// to the server in the request (so it should not return any +// out-of-bounds results). QGeoCodeReplyNokia::QGeoCodeReplyNokia(QNetworkReply *reply, int limit, int offset, - const QGeoShape &viewport, QObject *parent) -: QGeoCodeReply(parent), m_parsing(false) + const QGeoShape &viewport, bool manualBoundsRequired, + QObject *parent) +: QGeoCodeReply(parent), m_parsing(false), m_manualBoundsRequired(manualBoundsRequired) { if (!reply) { setError(UnknownError, QStringLiteral("Null reply")); @@ -80,8 +86,9 @@ void QGeoCodeReplyNokia::networkFinished() if (reply->error() != QNetworkReply::NoError) return; - QGeoCodeXmlParser *parser = new QGeoCodeXmlParser; - parser->setBounds(viewport()); + QGeoCodeJsonParser *parser = new QGeoCodeJsonParser; // QRunnable, autoDelete = true. + if (m_manualBoundsRequired) + parser->setBounds(viewport()); connect(parser, SIGNAL(results(QList<QGeoLocation>)), this, SLOT(appendResults(QList<QGeoLocation>))); connect(parser, SIGNAL(error(QString)), this, SLOT(parseError(QString))); |