Commit 5af4059f authored by Volker Krause's avatar Volker Krause
Browse files

Also do provider-based backend selection when querying alternatives

parent 83bbce94
......@@ -157,6 +157,7 @@ private Q_SLOTS:
{
ReservationManager mgr;
Test::clearAll(&mgr);
LiveDataManager ldm;
ApplicationController ctrl;
ctrl.setReservationManager(&mgr);
ctrl.importFromUrl(QUrl::fromLocalFile(QLatin1String(SOURCE_DIR "/../tests/randa2017.json")));
......@@ -164,6 +165,7 @@ private Q_SLOTS:
TimelineDelegateController controller;
controller.setReservationManager(&mgr);
controller.setBatchId(mgr.batches().at(0)); // flight
controller.setLiveDataManager(&ldm);
QVERIFY(!controller.journeyRequest().isValid());
controller.setBatchId(mgr.batches().at(1)); // first train segment
......
......@@ -403,7 +403,7 @@ static bool isLayover(const QVariant &res1, const QVariant &res2)
KPublicTransport::JourneyRequest TimelineDelegateController::journeyRequest() const
{
if (!m_resMgr || m_batchId.isEmpty()) {
if (!m_resMgr || m_batchId.isEmpty() || !m_liveDataMgr) {
return {};
}
......@@ -420,6 +420,7 @@ KPublicTransport::JourneyRequest TimelineDelegateController::journeyRequest() co
req.setDownloadAssets(true);
req.setIncludeIntermediateStops(true);
req.setIncludePaths(true);
PublicTransport::selectBackends(req, m_liveDataMgr->publicTransportManager(), res);
// find full journey by looking at subsequent elements
auto prevRes = res;
......
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