Commit 6a9380f0 authored by Volker Krause's avatar Volker Krause
Browse files

Remove manual Grantlee gadget export code

This is no longer needed as we depend on Grantlee 5.2 here, which supports
this out of the box.
parent 8939842e
Pipeline #48876 failed with stage
in 21 minutes and 9 seconds
......@@ -46,83 +46,7 @@
using namespace KItinerary;
// Grantlee has no Q_GADGET support yet
#define GRANTLEE_MAKE_GADGET(Class) \
GRANTLEE_BEGIN_LOOKUP(Class) \
const auto idx = Class::staticMetaObject.indexOfProperty(property.toUtf8().constData()); \
if (idx < 0) { \
return {}; \
} \
const auto mp = Class::staticMetaObject.property(idx); \
return mp.readOnGadget(&object); \
GRANTLEE_END_LOOKUP
GRANTLEE_MAKE_GADGET(Airport)
GRANTLEE_MAKE_GADGET(Airline)
GRANTLEE_MAKE_GADGET(Event)
GRANTLEE_MAKE_GADGET(EventReservation)
GRANTLEE_MAKE_GADGET(Flight)
GRANTLEE_MAKE_GADGET(FlightReservation)
GRANTLEE_MAKE_GADGET(GeoCoordinates)
GRANTLEE_MAKE_GADGET(LodgingBusiness)
GRANTLEE_MAKE_GADGET(LodgingReservation)
GRANTLEE_MAKE_GADGET(Person)
GRANTLEE_MAKE_GADGET(Place)
GRANTLEE_MAKE_GADGET(PostalAddress)
GRANTLEE_MAKE_GADGET(Seat)
GRANTLEE_MAKE_GADGET(Ticket)
GRANTLEE_MAKE_GADGET(TrainStation)
GRANTLEE_MAKE_GADGET(TrainTrip)
GRANTLEE_MAKE_GADGET(TrainReservation)
GRANTLEE_MAKE_GADGET(BusStation)
GRANTLEE_MAKE_GADGET(BusTrip)
GRANTLEE_MAKE_GADGET(BusReservation)
GRANTLEE_MAKE_GADGET(CancelAction)
GRANTLEE_MAKE_GADGET(CheckInAction)
GRANTLEE_MAKE_GADGET(DownloadAction)
GRANTLEE_MAKE_GADGET(UpdateAction)
GRANTLEE_MAKE_GADGET(ViewAction)
GRANTLEE_MAKE_GADGET(FoodEstablishment)
GRANTLEE_MAKE_GADGET(FoodEstablishmentReservation)
GRANTLEE_MAKE_GADGET(RentalCarReservation)
GRANTLEE_MAKE_GADGET(RentalCar)
GRANTLEE_MAKE_GADGET(Brand)
GRANTLEE_MAKE_GADGET(Organization)
ItineraryRenderer::ItineraryRenderer()
{
Grantlee::registerMetaType<Airport>();
Grantlee::registerMetaType<Airline>();
Grantlee::registerMetaType<Event>();
Grantlee::registerMetaType<EventReservation>();
Grantlee::registerMetaType<Flight>();
Grantlee::registerMetaType<FlightReservation>();
Grantlee::registerMetaType<GeoCoordinates>();
Grantlee::registerMetaType<LodgingBusiness>();
Grantlee::registerMetaType<LodgingReservation>();
Grantlee::registerMetaType<Person>();
Grantlee::registerMetaType<Place>();
Grantlee::registerMetaType<PostalAddress>();
Grantlee::registerMetaType<Seat>();
Grantlee::registerMetaType<Ticket>();
Grantlee::registerMetaType<TrainStation>();
Grantlee::registerMetaType<TrainTrip>();
Grantlee::registerMetaType<TrainReservation>();
Grantlee::registerMetaType<BusStation>();
Grantlee::registerMetaType<BusTrip>();
Grantlee::registerMetaType<BusReservation>();
Grantlee::registerMetaType<CancelAction>();
Grantlee::registerMetaType<CheckInAction>();
Grantlee::registerMetaType<DownloadAction>();
Grantlee::registerMetaType<UpdateAction>();
Grantlee::registerMetaType<ViewAction>();
Grantlee::registerMetaType<FoodEstablishment>();
Grantlee::registerMetaType<FoodEstablishmentReservation>();
Grantlee::registerMetaType<RentalCarReservation>();
Grantlee::registerMetaType<RentalCar>();
Grantlee::registerMetaType<Brand>();
Grantlee::registerMetaType<Organization>();
}
ItineraryRenderer::ItineraryRenderer() = default;
void ItineraryRenderer::setKDEConnectHandler(ItineraryKDEConnectHandler *kdeConnect)
{
......
......@@ -41,20 +41,6 @@ static bool isPkPassContent(KMime::Content *content)
return cd && cd->filename().endsWith(QLatin1String("pkpass"));
}
// Grantlee has no Q_GADGET support yet
#define GRANTLEE_MAKE_GADGET(Class) \
GRANTLEE_BEGIN_LOOKUP(Class) \
const auto idx = Class::staticMetaObject.indexOfProperty(property.toUtf8().constData()); \
if (idx < 0) { \
return {}; \
} \
const auto mp = Class::staticMetaObject.property(idx); \
return mp.readOnGadget(&object); \
GRANTLEE_END_LOOKUP
GRANTLEE_MAKE_GADGET(KPkPass::Barcode)
GRANTLEE_MAKE_GADGET(KPkPass::Field)
namespace
{
class Formatter : public MessageViewer::MessagePartRendererBase
......@@ -171,8 +157,6 @@ public:
explicit Plugin(QObject *parent = nullptr)
: QObject(parent)
{
Grantlee::registerMetaType<KPkPass::Barcode>();
Grantlee::registerMetaType<KPkPass::Field>();
}
MessageViewer::MessagePartRendererBase *renderer(int index) override
......
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