diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,7 +77,7 @@ set(AKONADI_LIB_VERSION "5.6.40") set(INCIDENCEEDITOR_LIB_VERSION "5.6.40") set(KTNEF_LIB_VERSION "5.6.40") -set(MESSAGELIB_LIB_VERSION "5.6.50") +set(MESSAGELIB_LIB_VERSION "5.6.51") set(AKONADICALENDAR_LIB_VERSION "5.6.40") set(CALENDAR_UTILS_VERSION "5.6.40") set(KPIMTEXTEDIT_LIB_VERSION "5.6.40") diff --git a/plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp b/plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp --- a/plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp +++ b/plugins/messageviewer/bodypartformatter/calendar/text_calendar.cpp @@ -41,6 +41,7 @@ #include #include +#include #include #include #include @@ -282,7 +283,7 @@ return message->event().dynamicCast(); } -class UrlHandler : public MimeTreeParser::Interface::BodyPartURLHandler +class UrlHandler : public MessageViewer::Interface::BodyPartURLHandler { public: UrlHandler() @@ -1474,10 +1475,11 @@ } }; -class Plugin : public QObject, public MimeTreeParser::Interface::BodyPartFormatterPlugin +class Plugin : public QObject, public MimeTreeParser::Interface::BodyPartFormatterPlugin, public MessageViewer::MessagePartRenderPlugin { Q_OBJECT Q_INTERFACES(MimeTreeParser::Interface::BodyPartFormatterPlugin) + Q_INTERFACES(MessageViewer::MessagePartRenderPlugin) Q_PLUGIN_METADATA(IID "com.kde.messageviewer.bodypartformatter" FILE "text_calendar.json") public: const MimeTreeParser::Interface::BodyPartFormatter *bodyPartFormatter(int idx) const override @@ -1489,7 +1491,13 @@ } } - const MimeTreeParser::Interface::BodyPartURLHandler *urlHandler(int idx) const override + MessageViewer::MessagePartRendererBase* renderer(int index) override + { + Q_UNUSED(index); + return nullptr; + } + + const MessageViewer::Interface::BodyPartURLHandler *urlHandler(int idx) const override { if (idx == 0) { return new UrlHandler(); diff --git a/plugins/messageviewer/bodypartformatter/calendar/text_calendar.json b/plugins/messageviewer/bodypartformatter/calendar/text_calendar.json --- a/plugins/messageviewer/bodypartformatter/calendar/text_calendar.json +++ b/plugins/messageviewer/bodypartformatter/calendar/text_calendar.json @@ -1,5 +1,8 @@ -{ "formatter": - [ +{ + "formatter": [ { "mimetype": "text/calendar" } + ], + "renderer": [ + { "type": "MimeTreeParser::AttachmentMessagePart" } ] } diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwks.json b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwks.json --- a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwks.json +++ b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwks.json @@ -1,7 +1,10 @@ -{ "formatter": - [ +{ + "formatter": [ { "mimetype": "multipart/mixed" }, { "mimetype": "application/vnd.gnupg.wks" }, { "mimetype": "application/pgp-keys" } + ], + "renderer": [ + { "type": "MimeTreeParser::AttachmentMessagePart" } ] } diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.cpp b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.cpp --- a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.cpp +++ b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksformatter.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksurlhandler.h b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksurlhandler.h --- a/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksurlhandler.h +++ b/plugins/messageviewer/bodypartformatter/gnupgwks/gnupgwksurlhandler.h @@ -26,7 +26,7 @@ class GnuPGWKSMessagePart; -class ApplicationGnuPGWKSUrlHandler : public MimeTreeParser::Interface::BodyPartURLHandler +class ApplicationGnuPGWKSUrlHandler : public MessageViewer::Interface::BodyPartURLHandler { public: ApplicationGnuPGWKSUrlHandler() = default; diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyurlhandler.h b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyurlhandler.h --- a/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyurlhandler.h +++ b/plugins/messageviewer/bodypartformatter/gnupgwks/pgpkeyurlhandler.h @@ -24,7 +24,7 @@ class QUrlQuery; -class ApplicationPgpKeyUrlHandler : public MimeTreeParser::Interface::BodyPartURLHandler +class ApplicationPgpKeyUrlHandler : public MessageViewer::Interface::BodyPartURLHandler { public: ApplicationPgpKeyUrlHandler() = default; diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h b/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h --- a/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h +++ b/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.h @@ -20,18 +20,21 @@ #ifndef GNUPGWKSPLUGIN_H #define GNUPGWKSPLUGIN_H +#include #include -class ApplicationGnuPGWKSPlugin : public QObject, public MimeTreeParser::Interface::BodyPartFormatterPlugin +class ApplicationGnuPGWKSPlugin : public QObject, public MimeTreeParser::Interface::BodyPartFormatterPlugin, public MessageViewer::MessagePartRenderPlugin { Q_OBJECT Q_INTERFACES(MimeTreeParser::Interface::BodyPartFormatterPlugin) + Q_INTERFACES(MessageViewer::MessagePartRenderPlugin) Q_PLUGIN_METADATA(IID "com.kde.messageviewer.bodypartformatter" FILE "gnupgwks.json") public: ApplicationGnuPGWKSPlugin() = default; const MimeTreeParser::Interface::BodyPartFormatter *bodyPartFormatter(int idx) const override; - const MimeTreeParser::Interface::BodyPartURLHandler *urlHandler(int idx) const override; + MessageViewer::MessagePartRendererBase* renderer(int index) override; + const MessageViewer::Interface::BodyPartURLHandler *urlHandler(int idx) const override; }; #endif diff --git a/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp b/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp --- a/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp +++ b/plugins/messageviewer/bodypartformatter/gnupgwks/plugin.cpp @@ -45,7 +45,13 @@ } } -const MimeTreeParser::Interface::BodyPartURLHandler *ApplicationGnuPGWKSPlugin::urlHandler(int idx) const +MessageViewer::MessagePartRendererBase* ApplicationGnuPGWKSPlugin::renderer(int index) +{ + Q_UNUSED(index); + return nullptr; +} + +const MessageViewer::Interface::BodyPartURLHandler *ApplicationGnuPGWKSPlugin::urlHandler(int idx) const { switch (idx) { case multipart_mixed: diff --git a/plugins/messageviewer/bodypartformatter/vcard/text_vcard.cpp b/plugins/messageviewer/bodypartformatter/vcard/text_vcard.cpp --- a/plugins/messageviewer/bodypartformatter/vcard/text_vcard.cpp +++ b/plugins/messageviewer/bodypartformatter/vcard/text_vcard.cpp @@ -39,6 +39,7 @@ #include +#include #include #include #include @@ -179,7 +180,7 @@ } }; -class UrlHandler : public MimeTreeParser::Interface::BodyPartURLHandler +class UrlHandler : public MessageViewer::Interface::BodyPartURLHandler { public: bool handleClick(MessageViewer::Viewer *viewerInstance, BodyPart *bodyPart, const QString &path) const override @@ -301,18 +302,25 @@ } }; -class Plugin : public QObject, public MimeTreeParser::Interface::BodyPartFormatterPlugin +class Plugin : public QObject, public MimeTreeParser::Interface::BodyPartFormatterPlugin, public MessageViewer::MessagePartRenderPlugin { Q_OBJECT Q_INTERFACES(MimeTreeParser::Interface::BodyPartFormatterPlugin) + Q_INTERFACES(MessageViewer::MessagePartRenderPlugin) Q_PLUGIN_METADATA(IID "com.kde.messageviewer.bodypartformatter" FILE "text_vcard.json") public: const MimeTreeParser::Interface::BodyPartFormatter *bodyPartFormatter(int idx) const override { return validIndex(idx) ? new Formatter() : nullptr; } - const MimeTreeParser::Interface::BodyPartURLHandler *urlHandler(int idx) const override + MessageViewer::MessagePartRendererBase* renderer(int index) override + { + Q_UNUSED(index); + return nullptr; + } + + const MessageViewer::Interface::BodyPartURLHandler *urlHandler(int idx) const override { return validIndex(idx) ? new UrlHandler() : nullptr; } diff --git a/plugins/messageviewer/bodypartformatter/vcard/text_vcard.json b/plugins/messageviewer/bodypartformatter/vcard/text_vcard.json --- a/plugins/messageviewer/bodypartformatter/vcard/text_vcard.json +++ b/plugins/messageviewer/bodypartformatter/vcard/text_vcard.json @@ -1,5 +1,8 @@ -{ "formatter": - [ +{ + "formatter": [ { "mimetype": "text/vcard" } + ], + "renderer": [ + { "type": "MimeTreeParser::AttachmentMessagePart" } ] }