summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Rauter <matthias.rauter@qt.io>2023-01-05 11:09:15 +0100
committerMatthias Rauter <matthias.rauter@qt.io>2023-01-05 15:06:26 +0100
commitb6176fa8a3d806ad2c83e8dbff4709ae315e7b5b (patch)
treeed6f69b57cb8fd6d83b2fb4ca2af254071f14366
parentd66d46f717b51ca093b46c9395183fd58de256b6 (diff)
downloadqtlocation-b6176fa8a3d806ad2c83e8dbff4709ae315e7b5b.tar.gz
Add Title and Streetnumber to QPlaceSearchReplyOsm
Pick-to: 6.5 Change-Id: I94e6c673b8aa3ccdc6adf4b3ce5a87b13415475b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--src/plugins/geoservices/osm/qplacesearchreplyosm.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/geoservices/osm/qplacesearchreplyosm.cpp b/src/plugins/geoservices/osm/qplacesearchreplyosm.cpp
index deb68e0e..ade7fe23 100644
--- a/src/plugins/geoservices/osm/qplacesearchreplyosm.cpp
+++ b/src/plugins/geoservices/osm/qplacesearchreplyosm.cpp
@@ -186,8 +186,8 @@ QPlaceResult QPlaceSearchReplyOsm::parsePlaceResult(const QJsonObject &item) con
item.value(QStringLiteral("lon")).toString().toDouble());
//const QString placeRank = item.value(QStringLiteral("place_rank")).toString();
- //const QString category = item.value(QStringLiteral("category")).toString();
- const QString type = item.value(QStringLiteral("type")).toString();
+ const QString category = item.value(QStringLiteral("category")).toString();
+ // const QString type = item.value(QStringLiteral("type")).toString();
//double importance = item.value(QStringLiteral("importance")).toDouble();
place.setAttribution(item.value(QStringLiteral("licence")).toString());
@@ -202,7 +202,7 @@ QPlaceResult QPlaceSearchReplyOsm::parsePlaceResult(const QJsonObject &item) con
QJsonObject addressDetails = item.value(QStringLiteral("address")).toObject();
- const QString title = addressDetails.value(type).toString();
+ const QString title = addressDetails.value(category).toString();
place.setName(title);
@@ -220,6 +220,7 @@ QPlaceResult QPlaceSearchReplyOsm::parsePlaceResult(const QJsonObject &item) con
//address.setCountryCode(addressDetails.value(QStringLiteral("country_code")).toString());
address.setPostalCode(addressDetails.value(QStringLiteral("postcode")).toString());
address.setStreet(addressDetails.value(QStringLiteral("road")).toString());
+ address.setStreetNumber(addressDetails.value(QStringLiteral("house_number")).toString());
address.setState(addressDetails.value(QStringLiteral("state")).toString());
address.setDistrict(addressDetails.value(QStringLiteral("suburb")).toString());