diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-07-14 12:03:14 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-07-16 07:57:19 +0000 |
commit | 5b66377db126b4a8a3d4bcf28b812d54b45b461a (patch) | |
tree | 530776b0ac2ba13958891a5a3bde9038ad19b535 /src/plugins | |
parent | 3807b83c62b595727a3e5caea907616fe5899909 (diff) | |
download | qtlocation-5b66377db126b4a8a3d4bcf28b812d54b45b461a.tar.gz |
Add missing url parameter for OSM places search.
Fixes a few minor grammar/spelling issues in related documentation too.
Change-Id: I21c153596b02931c66a38f7068173c687cbe0ad9
Task-number: QTBUG-47188
Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/geoservices/osm/qplacemanagerengineosm.cpp | 7 | ||||
-rw-r--r-- | src/plugins/geoservices/osm/qplacemanagerengineosm.h | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/geoservices/osm/qplacemanagerengineosm.cpp b/src/plugins/geoservices/osm/qplacemanagerengineosm.cpp index 2ae5bd7e..ed2c9ff0 100644 --- a/src/plugins/geoservices/osm/qplacemanagerengineosm.cpp +++ b/src/plugins/geoservices/osm/qplacemanagerengineosm.cpp @@ -97,6 +97,11 @@ QPlaceManagerEngineOsm::QPlaceManagerEngineOsm(const QVariantMap ¶meters, else m_userAgent = "Qt Location based application"; + if (parameters.contains(QStringLiteral("osm.places.host"))) + m_urlPrefix = parameters.value(QStringLiteral("osm.places.host")).toString(); + else + m_urlPrefix = QStringLiteral("http://nominatim.openstreetmap.org/search"); + *error = QGeoServiceProvider::NoError; errorString->clear(); } @@ -175,7 +180,7 @@ QPlaceSearchReply *QPlaceManagerEngineOsm::search(const QPlaceSearchRequest &req queryItems.addQueryItem(QStringLiteral("addressdetails"), QStringLiteral("1")); - QUrl requestUrl(QStringLiteral("http://nominatim.openstreetmap.org/search?")); + QUrl requestUrl(m_urlPrefix); requestUrl.setQuery(queryItems); QNetworkReply *networkReply = m_networkManager->get(QNetworkRequest(requestUrl)); diff --git a/src/plugins/geoservices/osm/qplacemanagerengineosm.h b/src/plugins/geoservices/osm/qplacemanagerengineosm.h index 9a15b493..828d7bf1 100644 --- a/src/plugins/geoservices/osm/qplacemanagerengineosm.h +++ b/src/plugins/geoservices/osm/qplacemanagerengineosm.h @@ -75,6 +75,7 @@ private: QNetworkAccessManager *m_networkManager; QByteArray m_userAgent; + QString m_urlPrefix; QList<QLocale> m_locales; QNetworkReply *m_categoriesReply; |