Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 97efca87 authored by Volker Krause's avatar Volker Krause

Add show on map actions for train stations too

parent e545a748
......@@ -138,6 +138,22 @@ bool SemanticUrlHandler::handleContextMenuRequest(MimeTreeParser::Interface::Bod
addGoToMapAction(&menu, airport);
places.insert(iataCode);
}
} else if (r.userType() == qMetaTypeId<TrainReservation>()) {
const auto trip = JsonLdDocument::readProperty(r, "reservationFor");
auto station = JsonLdDocument::readProperty(trip, "departureStation");
auto name = JsonLdDocument::readProperty(station, "name").toString();
if (!places.contains(name)) {
addGoToMapAction(&menu, station);
places.insert(name);
}
station = JsonLdDocument::readProperty(trip, "arrivalStation");
name = JsonLdDocument::readProperty(station, "name").toString();
if (!places.contains(name)) {
addGoToMapAction(&menu, station);
places.insert(name);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment