Commit 83eb6b58 authored by Volker Krause's avatar Volker Krause
Browse files

Add sorting support for boat/ferry trips

parent d4e19202
Pipeline #207129 canceled with stage
in 1 minute and 38 seconds
......@@ -6,6 +6,7 @@
#include "sortutil.h"
#include <KItinerary/BoatTrip>
#include <KItinerary/BusTrip>
#include <KItinerary/Event>
#include <KItinerary/Flight>
......@@ -77,6 +78,9 @@ QDateTime SortUtil::startDateTime(const QVariant &elem)
if (JsonLd::isA<BusTrip>(elem)) {
return elem.value<BusTrip>().departureTime();
}
if (JsonLd::isA<BoatTrip>(elem)) {
return elem.value<BoatTrip>().departureTime();
}
if (JsonLd::isA<Event>(elem)) {
return elem.value<Event>().startDate();
}
......@@ -137,6 +141,9 @@ QDateTime SortUtil::endDateTime(const QVariant &elem)
if (JsonLd::isA<BusTrip>(elem)) {
return elem.value<BusTrip>().arrivalTime();
}
if (JsonLd::isA<BoatTrip>(elem)) {
return elem.value<BoatTrip>().arrivalTime();
}
return {};
}
......
Supports Markdown
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