Commit 07dde4fb authored by Volker Krause's avatar Volker Krause

Put all other flight information we have into the ical description

parent 71923145
......@@ -7,7 +7,7 @@ DTSTAMP:20171227T111649Z
CREATED:20171227T111649Z
UID:1b22236a-21ff-4885-8c99-b3b2bbca062c
LAST-MODIFIED:20171227T111649Z
DESCRIPTION:Booking reference: XXX007
DESCRIPTION:Boarding time: 14:25\nDeparture gate: 16\nBoarding group: C\nSeat: 16E\nBooking reference: XXX007
SUMMARY:Flight AB 8075 from HEL to TXL
LOCATION:Helsinki
GEO:60.317200;24.963301
......
......@@ -64,9 +64,6 @@ void CalendarHandler::fillFlightReservation(const QVariant &reservation, const K
event->setDtStart(JsonLdDocument::readProperty(flight, "departureTime").toDateTime());
event->setDtEnd(JsonLdDocument::readProperty(flight, "arrivalTime").toDateTime());
event->setAllDay(false);
event->setDescription(i18n("Booking reference: %1",
JsonLdDocument::readProperty(reservation, "reservationNumber").toString()
));
const auto boardingTime = JsonLdDocument::readProperty(flight, "boardingTime").toDateTime();
const auto departureGate = JsonLdDocument::readProperty(flight, "departureGate").toString();
......@@ -80,6 +77,27 @@ void CalendarHandler::fillFlightReservation(const QVariant &reservation, const K
alarm->setEnabled(true);
event->addAlarm(alarm);
}
QStringList desc;
if (boardingTime.isValid()) {
desc.push_back(i18n("Boarding time: %1", QLocale().toString(boardingTime.time(), QLocale::ShortFormat)));
}
if (!departureGate.isEmpty()) {
desc.push_back(i18n("Departure gate: %1", departureGate));
}
auto s = JsonLdDocument::readProperty(reservation, "boardingGroup").toString();
if (!s.isEmpty()) {
desc.push_back(i18n("Boarding group: %1", s));
}
s = JsonLdDocument::readProperty(reservation, "airplaneSeat").toString();
if (!s.isEmpty()) {
desc.push_back(i18n("Seat: %1", s));
}
s = JsonLdDocument::readProperty(reservation, "reservationNumber").toString();
if (!s.isEmpty()) {
desc.push_back(i18n("Booking reference: %1", s));
}
event->setDescription(desc.join(QLatin1Char('\n')));
}
void CalendarHandler::fillTrainReservation(const QVariant &reservation, const KCalCore::Event::Ptr &event)
......
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