Commit f0e48881 authored by Volker Krause's avatar Volker Krause
Browse files

Port away from deprecated KItinerary::ExtractorEngine API

parent db3655dc
Pipeline #56212 passed with stage
in 55 minutes and 39 seconds
......@@ -87,7 +87,7 @@ set(AKONADICONTACT_LIB_VERSION "5.17.40")
set(IMPORTWIZARD_LIB_VERSION "5.17.40")
set(MAILIMPORTER_LIB_VERSION "5.17.40")
set(KPIMPKPASS_LIB_VERSION "5.17.40")
set(KPIMITINERARY_LIB_VERSION "5.17.40")
set(KPIMITINERARY_LIB_VERSION "5.17.41")
set(KONTACTINTERFACE_LIB_VERSION "5.17.40")
set(AKONADINOTES_LIB_VERSION "5.17.40")
find_package(KF5AkonadiNotes ${AKONADINOTES_LIB_VERSION} CONFIG REQUIRED)
......
......@@ -96,22 +96,21 @@ MimeTreeParser::MessagePart::Ptr ItineraryProcessor::process(MimeTreeParser::Int
ExtractorEngine engine;
engine.setUseSeparateProcess(true);
engine.setContext(part.content());
engine.setContext(QVariant::fromValue<KMime::Content *>(part.content()), u"message/rfc822");
if (isPkPassContent(part.content())) {
pass.reset(KPkPass::Pass::fromData(part.content()->decodedContent()));
engine.setPass(pass.get());
engine.setContent(QVariant::fromValue<KPkPass::Pass *>(pass.get()), u"application/vnd.apple.pkpass");
} else if (part.content()->contentType()->isHTMLText()) {
engine.setData(part.content()->decodedContent(), ExtractorInput::Html);
engine.setData(part.content()->decodedContent());
} else if (part.content()->contentType()->mimeType() == "application/pdf"
|| part.content()->contentType()->name().endsWith(QLatin1String(".pdf"), Qt::CaseInsensitive)) {
isPdf = true;
engine.setData(part.content()->decodedContent(), ExtractorInput::Pdf);
engine.setData(part.content()->decodedContent());
} else if (isCalendarContent(part.content())) {
engine.setData(part.content()->decodedContent(), ExtractorInput::ICal);
engine.setData(part.content()->decodedContent());
} else if (part.content()->contentType()->isPlainText()) {
engine.setText(part.content()->decodedText());
engine.setContent(part.content()->decodedText(), u"text/plain");
} else {
// we have extractors but this isn't a mimetype we understand
return {};
}
......
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