Commit d9d3c5d4 authored by Sandro Knauß's avatar Sandro Knauß

Update API usage of mimetreeparser

see: T6166
parent 56175d91
......@@ -70,7 +70,7 @@ set(LIBKLEO_LIB_VERSION "5.5.40")
set(AKONADI_LIB_VERSION "5.5.40")
set(INCIDENCEEDITOR_LIB_VERSION "5.5.40")
set(KTNEF_LIB_VERSION "5.5.40")
set(MESSAGELIB_LIB_VERSION "5.5.41")
set(MESSAGELIB_LIB_VERSION "5.5.44")
set(AKONADICALENDAR_LIB_VERSION "5.5.40")
set(CALENDAR_UTILS_VERSION "5.5.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.5.40")
......
......@@ -92,11 +92,6 @@ public:
return MimeTreeParser::AttachmentStrategy::smart();
}
QObject *sourceObject() Q_DECL_OVERRIDE
{
return nullptr;
}
bool autoImportKeys() const Q_DECL_OVERRIDE
{
return false;
......
......@@ -181,19 +181,16 @@ private:
class Formatter : public MimeTreeParser::Interface::BodyPartFormatter
{
public:
Result format(MimeTreeParser::Interface::BodyPart *part, MimeTreeParser::HtmlWriter *writer) const Q_DECL_OVERRIDE
{
return format(part, writer, nullptr);
}
Result format(MimeTreeParser::Interface::BodyPart *bodyPart, MimeTreeParser::HtmlWriter *writer, QObject *asyncResultObserver) const Q_DECL_OVERRIDE
Result format(MimeTreeParser::Interface::BodyPart *bodyPart, MimeTreeParser::HtmlWriter *writer) const Q_DECL_OVERRIDE
{
if (!writer) {
// Guard against crashes in createReply()
return Ok;
}
if (!asyncResultObserver) {
auto nodeHelper = bodyPart->nodeHelper();
if (!nodeHelper) {
return Ok;
}
......@@ -239,8 +236,8 @@ public:
} else {
MemoryCalendarMemento *memento = new MemoryCalendarMemento();
bodyPart->setBodyPartMemento(memento);
QObject::connect(memento, SIGNAL(update(MimeTreeParser::UpdateMode)),
asyncResultObserver, SLOT(update(MimeTreeParser::UpdateMode)));
QObject::connect(memento, &MemoryCalendarMemento::update,
nodeHelper, &MimeTreeParser::NodeHelper::update);
}
return Ok;
......
......@@ -71,11 +71,6 @@ Interface::MessagePart::Ptr ApplicationGnuPGWKSFormatter::process(BodyPart &part
}
BodyPartFormatter::Result ApplicationGnuPGWKSFormatter::format(BodyPart *part, MimeTreeParser::HtmlWriter *writer) const
{
return format(part, writer, nullptr);
}
BodyPartFormatter::Result ApplicationGnuPGWKSFormatter::format(BodyPart *part, MimeTreeParser::HtmlWriter *writer, QObject *obj) const
{
if (!writer) {
return Ok;
......@@ -86,7 +81,7 @@ BodyPartFormatter::Result ApplicationGnuPGWKSFormatter::format(BodyPart *part, M
const auto mixed = registry.find("mixed");
Q_ASSERT(mixed != registry.end()); // there *must* be a multipart/mixed handler
return mixed->second->format(part, writer, obj);
return mixed->second->format(part, writer);
}
const auto content = part->content()->decodedContent();
......
......@@ -33,7 +33,6 @@ public:
MimeTreeParser::Interface::MessagePart::Ptr process(MimeTreeParser::Interface::BodyPart &part) const Q_DECL_OVERRIDE;
MimeTreeParser::Interface::BodyPartFormatter::Result format(MimeTreeParser::Interface::BodyPart *part, MimeTreeParser::HtmlWriter *writer) const Q_DECL_OVERRIDE;
MimeTreeParser::Interface::BodyPartFormatter::Result format(MimeTreeParser::Interface::BodyPart *part, MimeTreeParser::HtmlWriter *writer, QObject *asyncResultObserver) const Q_DECL_OVERRIDE;
private:
enum WKSStatus {
......
......@@ -37,11 +37,6 @@
using namespace MimeTreeParser::Interface;
BodyPartFormatter::Result ApplicationPGPKeyFormatter::format(BodyPart *part, MimeTreeParser::HtmlWriter *writer) const
{
return format(part, writer, nullptr);
}
BodyPartFormatter::Result ApplicationPGPKeyFormatter::format(BodyPart *part, MimeTreeParser::HtmlWriter *writer, QObject *asyncResultObserver) const
{
if (!writer) {
return Ok;
......@@ -52,9 +47,10 @@ BodyPartFormatter::Result ApplicationPGPKeyFormatter::format(BodyPart *part, Mim
if (!m) {
auto memento = new PgpKeyMemento();
if (asyncResultObserver) {
QObject::connect(memento, SIGNAL(update(MimeTreeParser::UpdateMode)),
asyncResultObserver, SLOT(update(MimeTreeParser::UpdateMode)));
auto nodeHelper = part->nodeHelper();
if (nodeHelper) {
QObject::connect(memento, &PgpKeyMemento::update,
nodeHelper, &MimeTreeParser::NodeHelper::update);
memento->start(mp.fingerprint());
} else {
memento->exec(mp.fingerprint());
......
......@@ -30,7 +30,6 @@ public:
ApplicationPGPKeyFormatter() = default;
MimeTreeParser::Interface::BodyPartFormatter::Result format(MimeTreeParser::Interface::BodyPart *part, MimeTreeParser::HtmlWriter *writer) const Q_DECL_OVERRIDE;
MimeTreeParser::Interface::BodyPartFormatter::Result format(MimeTreeParser::Interface::BodyPart *part, MimeTreeParser::HtmlWriter *writer, QObject *asyncResultObserver) const Q_DECL_OVERRIDE;
private:
QString render(const PgpKeyMessagePart &mp) const;
......
......@@ -70,12 +70,7 @@ public:
{
}
Result format(MimeTreeParser::Interface::BodyPart *part, MimeTreeParser::HtmlWriter *writer) const Q_DECL_OVERRIDE
{
return format(part, writer, nullptr);
}
Result format(MimeTreeParser::Interface::BodyPart *bodyPart, MimeTreeParser::HtmlWriter *writer, QObject *asyncResultObserver) const Q_DECL_OVERRIDE
Result format(MimeTreeParser::Interface::BodyPart *bodyPart, MimeTreeParser::HtmlWriter *writer) const Q_DECL_OVERRIDE
{
if (!writer) {
return Ok;
......@@ -121,8 +116,10 @@ public:
MessageViewer::VcardMemento *memento = new MessageViewer::VcardMemento(lst);
bodyPart->setBodyPartMemento(memento);
if (asyncResultObserver) {
QObject::connect(memento, SIGNAL(update(MimeTreeParser::UpdateMode)), asyncResultObserver, SLOT(update(MimeTreeParser::UpdateMode)));
auto nodeHelper = bodyPart->nodeHelper();
if (nodeHelper) {
QObject::connect(memento, &MessageViewer::VcardMemento::update,
nodeHelper, &MimeTreeParser::NodeHelper::update);
}
}
......
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