Commit 11ba3d25 authored by Volker Krause's avatar Volker Krause
Browse files

Add findEvents overload taking a raw calendar pointer

Allows the use also if there is no shared pointer around, as those cannot
really be cleanly created on objects you don't own.
parent 21506e59
Pipeline #190439 passed with stage
in 8 minutes and 4 seconds
......@@ -64,7 +64,18 @@ static void fillRentalCarReservation(const RentalCarReservation &reservation, co
static void fillTaxiReservation(const TaxiReservation &reservation, const KCalendarCore::Event::Ptr &event);
#endif
QVector<QSharedPointer<KCalendarCore::Event> > CalendarHandler::findEvents(const QSharedPointer<KCalendarCore::Calendar> &calendar, const QVariant &reservation)
QVector<QSharedPointer<KCalendarCore::Event>> CalendarHandler::findEvents(const QSharedPointer<KCalendarCore::Calendar> &calendar, const QVariant &reservation)
{
#if HAVE_KCAL
return findEvents(calendar.data(), reservation);
#else
Q_UNUSED(calendar)
Q_UNUSED(reservation)
return {};
#endif
}
QVector<QSharedPointer<KCalendarCore::Event>> CalendarHandler::findEvents(KCalendarCore::Calendar *calendar, const QVariant &reservation)
{
#if HAVE_KCAL
if (!(JsonLd::canConvert<Reservation>(reservation) || JsonLd::canConvert<KItinerary::Event>(reservation)) || !calendar) {
......
......@@ -32,6 +32,7 @@ namespace CalendarHandler
* (e.g. all trip segments covered by the same reservation number).
* @since 20.08
*/
KITINERARY_EXPORT QVector<QSharedPointer<KCalendarCore::Event>> findEvents(KCalendarCore::Calendar *calendar, const QVariant &reservation);
KITINERARY_EXPORT QVector<QSharedPointer<KCalendarCore::Event>> findEvents(const QSharedPointer<KCalendarCore::Calendar> &calendar, const QVariant &reservation);
/** Attempts to find an event in @p calendar for @p reservation.
......
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