Commit 0a794330 authored by Volker Krause's avatar Volker Krause
Browse files

Make path retrieval an option in journey requests

parent 2afda728
Pipeline #50112 passed with stage
in 23 seconds
......@@ -104,7 +104,7 @@ bool HafasMgateBackend::queryJourney(const JourneyRequest &request, JourneyReply
req.insert(QStringLiteral("getEco"), false);
req.insert(QStringLiteral("getIST"), false);
req.insert(QStringLiteral("getPasslist"), request.includeIntermediateStops());
req.insert(QStringLiteral("getPolyline"), false);
req.insert(QStringLiteral("getPolyline"), request.includePaths());
req.insert(QStringLiteral("numF"), request.maximumResults());
QDateTime dt = request.dateTime();
......
......@@ -35,6 +35,7 @@ public:
int maximumResults = 12;
bool downloadAssets = false;
bool includeIntermediateStops = true;
bool includePaths = false;
};
}
......@@ -46,6 +47,7 @@ KPUBLICTRANSPORT_MAKE_PROPERTY(JourneyRequest, bool, downloadAssets, setDownload
KPUBLICTRANSPORT_MAKE_PROPERTY(JourneyRequest, JourneySection::Modes, modes, setModes)
KPUBLICTRANSPORT_MAKE_PROPERTY(JourneyRequest, int, maximumResults, setMaximumResults)
KPUBLICTRANSPORT_MAKE_PROPERTY(JourneyRequest, bool, includeIntermediateStops, setIncludeIntermediateStops)
KPUBLICTRANSPORT_MAKE_PROPERTY(JourneyRequest, bool, includePaths, setIncludePaths)
JourneyRequest::JourneyRequest(const Location &from, const Location &to)
: d(new JourneyRequestPrivate)
......
......@@ -57,6 +57,11 @@ class KPUBLICTRANSPORT_EXPORT JourneyRequest
* that all results will contain this information.
*/
KPUBLICTRANSPORT_PROPERTY(bool, includeIntermediateStops, setIncludeIntermediateStops)
/** Retrieve path details for the journeys.
* @note This is only an optimization hint for backends, not a guarantee
* that all results will contain this information.
*/
KPUBLICTRANSPORT_PROPERTY(bool, includePaths, setIncludePaths)
public:
enum DateTimeMode {
......
......@@ -390,6 +390,10 @@ Kirigami.ApplicationWindow {
checked: true
text: "Intermediate stops"
}
QQC2.CheckBox {
id: includePaths
text: "Paths"
}
}
QQC2.ComboBox {
......@@ -467,6 +471,7 @@ Kirigami.ApplicationWindow {
| (rentalMode.checked ? JourneySection.RentedVehicle : JourneySection.Invalid);
journeyModel.request.maximumResults = maxResults.text;
journeyModel.request.includeIntermediateStops = intermediateStops.checked;
journeyModel.request.includePaths = includePaths.checked;
}
}
QQC2.Button {
......@@ -490,6 +495,7 @@ Kirigami.ApplicationWindow {
| (rentalMode.checked ? JourneySection.RentedVehicle : JourneySection.Invalid);
journeyModel.request.maximumResults = maxResults.text;
journeyModel.request.includeIntermediateStops = intermediateStops.checked;
journeyModel.request.includePaths = includePaths.checked;
}
}
QQC2.Button {
......@@ -513,6 +519,7 @@ Kirigami.ApplicationWindow {
| (rentalMode.checked ? JourneySection.RentedVehicle : JourneySection.Invalid);
journeyModel.request.maximumResults = maxResults.text;
journeyModel.request.includeIntermediateStops = intermediateStops.checked;
journeyModel.request.includePaths = includePaths.checked;
}
}
QQC2.Button {
......
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