From f17701d5b0c336cb1cd52a80fb6439436b152f8e Mon Sep 17 00:00:00 2001 From: Mark Washeim Date: Tue, 9 Aug 2022 15:16:12 +0200 Subject: [PATCH] Applied station lookup changes to gps based search. --- src/parser/parser_resrobot.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/parser/parser_resrobot.cpp b/src/parser/parser_resrobot.cpp index 321c58c..cb82b48 100644 --- a/src/parser/parser_resrobot.cpp +++ b/src/parser/parser_resrobot.cpp @@ -449,17 +449,13 @@ void ParserResRobot::parseStationsByName(QNetworkReply *networkReply) QVariantList stations = doc.value("stopLocationOrCoordLocation").toList(); StationsList result; foreach (QVariant stationData, stations) { - const QVariantMap& ss = stationData.toMap(); - Station s; - // could inline QVariantMap station = ss["StopLocation"].toMap() ; - + Station s; s.id = station.value("extId").toString(); s.name = station.value("name").toString(); s.latitude = station.value("lat").toDouble(); s.longitude = station.value("lon").toDouble(); - result.append(s); } @@ -477,10 +473,12 @@ void ParserResRobot::parseStationsByCoordinates(QNetworkReply *networkReply) return; } - QVariantList stations = doc.value("StopLocation").toList(); + QVariantList stations = doc.value("stopLocationOrCoordLocation").toList(); + //QVariantList stations = doc.value("StopLocation").toList(); StationsList result; foreach (QVariant stationData, stations) { - const QVariantMap& station = stationData.toMap(); + const QVariantMap& ss = stationData.toMap(); + QVariantMap station = ss["StopLocation"].toMap() ; Station s; s.id = station.value("extId").toString(); s.name = station.value("name").toString();