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

Update API usage of mimetreeparser

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