From a011969f842d662b593e6b33c09dedd90c82de9c Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Sat, 18 Aug 2018 21:51:49 +0200 Subject: Set the request into QGeoRoute results in osm, mapbox plugins Change-Id: Iec8d1cb9ad369fe765e34bdcff2512e2726797ad Reviewed-by: Alex Blasche --- src/plugins/geoservices/mapbox/qgeoroutereplymapbox.cpp | 7 +++++++ src/plugins/geoservices/osm/qgeoroutereplyosm.cpp | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/mapbox/qgeoroutereplymapbox.cpp b/src/plugins/geoservices/mapbox/qgeoroutereplymapbox.cpp index c5f9d38c..8b0772ad 100644 --- a/src/plugins/geoservices/mapbox/qgeoroutereplymapbox.cpp +++ b/src/plugins/geoservices/mapbox/qgeoroutereplymapbox.cpp @@ -127,6 +127,13 @@ void QGeoRouteReplyMapbox::networkReplyFinished() QByteArray routeReply = reply->readAll(); QGeoRouteReply::Error error = parser->parseReply(routes, errorString, routeReply); + // Setting the request into the result + for (QGeoRoute &route : routes) { + route.setRequest(request()); + for (QGeoRoute &leg: route.routeLegs()) { + leg.setRequest(request()); + } + } QVariantMap metadata; metadata["osrm.reply-json"] = routeReply; diff --git a/src/plugins/geoservices/osm/qgeoroutereplyosm.cpp b/src/plugins/geoservices/osm/qgeoroutereplyosm.cpp index 732e8d72..af2a03b1 100644 --- a/src/plugins/geoservices/osm/qgeoroutereplyosm.cpp +++ b/src/plugins/geoservices/osm/qgeoroutereplyosm.cpp @@ -75,6 +75,13 @@ void QGeoRouteReplyOsm::networkReplyFinished() QList routes; QString errorString; QGeoRouteReply::Error error = parser->parseReply(routes, errorString, reply->readAll()); + // Setting the request into the result + for (QGeoRoute &route : routes) { + route.setRequest(request()); + for (QGeoRoute &leg: route.routeLegs()) { + leg.setRequest(request()); + } + } if (error == QGeoRouteReply::NoError) { setRoutes(routes.mid(0, request().numberAlternativeRoutes() + 1)); -- cgit v1.2.1