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

Port away from deprecated KItinerary::ExtractorEngine API

parent dcc5069b
...@@ -59,7 +59,7 @@ find_package(Qt5 CONFIG QUIET OPTIONAL_COMPONENTS QuickCompiler) ...@@ -59,7 +59,7 @@ find_package(Qt5 CONFIG QUIET OPTIONAL_COMPONENTS QuickCompiler)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS I18n CoreAddons Contacts Notifications) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS I18n CoreAddons Contacts Notifications)
find_package(KF5 ${KF5_MIN_VERSION} OPTIONAL_COMPONENTS Holidays NetworkManagerQt) find_package(KF5 ${KF5_MIN_VERSION} OPTIONAL_COMPONENTS Holidays NetworkManagerQt)
find_package(KPimPkPass CONFIG REQUIRED) find_package(KPimPkPass CONFIG REQUIRED)
find_package(KPimItinerary 5.14.41 CONFIG REQUIRED) find_package(KPimItinerary 5.17.41 CONFIG REQUIRED)
find_package(KPublicTransport CONFIG REQUIRED) find_package(KPublicTransport CONFIG REQUIRED)
find_package(KOSMIndoorMap CONFIG REQUIRED) find_package(KOSMIndoorMap CONFIG REQUIRED)
find_package(SharedMimeInfo 1.0 REQUIRED) find_package(SharedMimeInfo 1.0 REQUIRED)
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include <KItinerary/SortUtil> #include <KItinerary/SortUtil>
#include <KItinerary/Visit> #include <KItinerary/Visit>
#include <KPkPass/Pass>
#ifdef Q_OS_ANDROID #ifdef Q_OS_ANDROID
#include <KMime/Message> #include <KMime/Message>
#endif #endif
...@@ -158,7 +160,7 @@ QVector<QString> ReservationManager::importReservation(const QByteArray& data, c ...@@ -158,7 +160,7 @@ QVector<QString> ReservationManager::importReservation(const QByteArray& data, c
QVector<QString> ReservationManager::importReservation(KMime::Message *msg) QVector<QString> ReservationManager::importReservation(KMime::Message *msg)
{ {
ExtractorEngine engine; ExtractorEngine engine;
engine.setContent(msg); engine.setContent(QVariant::fromValue<KMime::Content*>(msg), u"message/rfc822");
return importReservations(JsonLdDocument::fromJson(engine.extract())); return importReservations(JsonLdDocument::fromJson(engine.extract()));
} }
#endif #endif
...@@ -334,7 +336,7 @@ void ReservationManager::passAdded(const QString& passId) ...@@ -334,7 +336,7 @@ void ReservationManager::passAdded(const QString& passId)
{ {
const auto pass = m_passMgr->pass(passId); const auto pass = m_passMgr->pass(passId);
ExtractorEngine engine; ExtractorEngine engine;
engine.setPass(pass); engine.setContent(QVariant::fromValue<KPkPass::Pass*>(pass), u"application/vnd.apple.pkpass");
const auto data = engine.extract(); const auto data = engine.extract();
const auto res = JsonLdDocument::fromJson(data); const auto res = JsonLdDocument::fromJson(data);
importReservations(res); importReservations(res);
......
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