Commit 2f28daa1 authored by Volker Krause's avatar Volker Krause
Browse files

Adapt to KPublicTransport API changes

Use non-deprecated vehicle type enum values, and request all journey
details.
parent 9778350d
...@@ -149,8 +149,10 @@ QString PublicTransport::rentalVehicleIcon(const KPublicTransport::RentalVehicle ...@@ -149,8 +149,10 @@ QString PublicTransport::rentalVehicleIcon(const KPublicTransport::RentalVehicle
case RentalVehicle::Unknown: case RentalVehicle::Unknown:
return {}; return {};
case RentalVehicle::Bicycle: case RentalVehicle::Bicycle:
case RentalVehicle::Pedelec: // TODO
return QStringLiteral("qrc:///images/bike.svg"); return QStringLiteral("qrc:///images/bike.svg");
case RentalVehicle::ElectricScooter: case RentalVehicle::ElectricMoped:
case RentalVehicle::ElectricKickScooter:
return QStringLiteral("question"); // TODO return QStringLiteral("question"); // TODO
case RentalVehicle::Car: case RentalVehicle::Car:
return QStringLiteral("qrc:///images/car.svg"); return QStringLiteral("qrc:///images/car.svg");
...@@ -351,7 +353,9 @@ bool PublicTransport::warnAboutSection(const KPublicTransport::JourneySection &s ...@@ -351,7 +353,9 @@ bool PublicTransport::warnAboutSection(const KPublicTransport::JourneySection &s
return false; return false;
case RentalVehicle::Bicycle: case RentalVehicle::Bicycle:
return section.duration() > 60*60 || section.distance() > 20000; return section.duration() > 60*60 || section.distance() > 20000;
case RentalVehicle::ElectricScooter: case RentalVehicle::ElectricKickScooter:
case RentalVehicle::ElectricMoped:
case RentalVehicle::Pedelec:
case RentalVehicle::Car: case RentalVehicle::Car:
return false; // ??? return false; // ???
} }
......
...@@ -417,6 +417,8 @@ KPublicTransport::JourneyRequest TimelineDelegateController::journeyRequest() co ...@@ -417,6 +417,8 @@ KPublicTransport::JourneyRequest TimelineDelegateController::journeyRequest() co
req.setDateTime(std::max(QDateTime::currentDateTime(), SortUtil::startDateTime(res))); req.setDateTime(std::max(QDateTime::currentDateTime(), SortUtil::startDateTime(res)));
req.setDateTimeMode(KPublicTransport::JourneyRequest::Departure); req.setDateTimeMode(KPublicTransport::JourneyRequest::Departure);
req.setDownloadAssets(true); req.setDownloadAssets(true);
req.setIncludeIntermediateStops(true);
req.setIncludePaths(true);
// find full journey by looking at subsequent elements // find full journey by looking at subsequent elements
auto prevRes = res; auto prevRes = res;
......
...@@ -507,6 +507,8 @@ KPublicTransport::JourneyRequest TransferManager::journeyRequestForTransfer(cons ...@@ -507,6 +507,8 @@ KPublicTransport::JourneyRequest TransferManager::journeyRequestForTransfer(cons
req.setDateTime(transfer.journeyTime()); req.setDateTime(transfer.journeyTime());
req.setDateTimeMode(transfer.alignment() == Transfer::Before ? JourneyRequest::Arrival : JourneyRequest::Departure); req.setDateTimeMode(transfer.alignment() == Transfer::Before ? JourneyRequest::Arrival : JourneyRequest::Departure);
req.setDownloadAssets(true); req.setDownloadAssets(true);
req.setIncludeIntermediateStops(true);
req.setIncludePaths(true);
return req; return req;
} }
......
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