Skip to content

Commit

Permalink
Applied station lookup changes to gps based search.
Browse files Browse the repository at this point in the history
  • Loading branch information
poetaster committed Aug 9, 2022
1 parent b4c5048 commit f17701d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/parser/parser_resrobot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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();
Expand Down

0 comments on commit f17701d

Please sign in to comment.