summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp
diff options
context:
space:
mode:
authorChris Adams <chris.adams@jollamobile.com>2016-11-04 15:14:07 +1000
committerAlex Blasche <alexander.blasche@qt.io>2016-11-16 06:36:23 +0000
commit78c73ebf88fbb97ebb796fc71e76232af5c8f1d3 (patch)
treeb225fea6cf830aa3b32eb316387e23de29f9f5df /src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp
parent81f626f062d95abe49fcb7d8f098e54646c04034 (diff)
downloadqtlocation-78c73ebf88fbb97ebb796fc71e76232af5c8f1d3.tar.gz
Update "nokia" geoservices plugin to use HERE APIs
The old Nokia URL endpoints are being deprecated. This commit updates the "nokia" plugin to use the modern HERE API endpoints. It also removes the (now nonexistent) China-specific URLs. Change-Id: Ieaf75cef1538d0ebb6a22623fc041ab504cf491f Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp')
-rw-r--r--src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp17
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 73d2d4c3..e99b9815 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_reply(reply), m_parsing(false)
+ const QGeoShape &viewport, bool manualBoundsRequired,
+ QObject *parent)
+: QGeoCodeReply(parent), m_reply(reply), m_parsing(false), m_manualBoundsRequired(manualBoundsRequired)
{
qRegisterMetaType<QList<QGeoLocation> >();
@@ -87,8 +93,9 @@ void QGeoCodeReplyNokia::networkFinished()
if (m_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)));