Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

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

reflect changes at mimetreeparser/messageviewer

parent 2d06a92e
......@@ -78,7 +78,7 @@ set(LIBKLEO_LIB_VERSION "5.6.80")
set(AKONADI_LIB_VERSION "5.6.80")
set(INCIDENCEEDITOR_LIB_VERSION "5.6.80")
set(KTNEF_LIB_VERSION "5.6.80")
set(MESSAGELIB_LIB_VERSION "5.6.80")
set(MESSAGELIB_LIB_VERSION "5.6.81")
set(AKONADICALENDAR_LIB_VERSION "5.6.80")
set(CALENDAR_UTILS_VERSION "5.6.80")
set(KPIMTEXTEDIT_LIB_VERSION "5.6.80")
......
......@@ -6,7 +6,7 @@
#include "mailreaderview.h"
#include "settings.h"
#include <MessageViewer/Viewer>
#include <MimeTreeParser/AttachmentStrategy>
#include <MessageViewer/AttachmentStrategy>
#include <messageviewersettings.h>
#include <KXmlGuiWindow>
#include <KConfigDialog>
......@@ -25,7 +25,7 @@ mailreaderView::mailreaderView(QWidget *parent)
ui_mailreaderview.setupUi(this);
QHBoxLayout *layout = new QHBoxLayout;
m_readerWin = new MessageViewer::Viewer(this, parent, dynamic_cast<KXmlGuiWindow *>(parent)->actionCollection());
m_readerWin->setAttachmentStrategy(MimeTreeParser::AttachmentStrategy::inlined());
m_readerWin->setAttachmentStrategy(MessageViewer::AttachmentStrategy::inlined());
layout->addWidget(m_readerWin);
setLayout(layout);
setAutoFillBackground(true);
......
......@@ -24,7 +24,7 @@
#include <MimeTreeParser/ObjectTreeParser>
#include <MessageViewer/CSSHelperBase>
#include <MimeTreeParser/FileHtmlWriter>
#include <MessageViewer/FileHtmlWriter>
#include <KMime/Message>
#include <QTest>
......@@ -78,7 +78,7 @@ void RenderTest::testRender()
msg->parse();
// render the mail
MimeTreeParser::FileHtmlWriter fileWriter(outFileName);
MessageViewer::FileHtmlWriter fileWriter(outFileName);
fileWriter.begin();
QImage paintDevice;
MessageViewer::CSSHelperBase cssHelper(&paintDevice);
......
......@@ -23,19 +23,19 @@
#include <MessageViewer/ObjectTreeEmptySource>
#include <MessageViewer/CSSHelperBase>
#include <MimeTreeParser/AttachmentStrategy>
#include <MessageViewer/AttachmentStrategy>
class TestObjectTreeSource : public MessageViewer::EmptySource
{
public:
TestObjectTreeSource(MimeTreeParser::HtmlWriter *writer, MessageViewer::CSSHelperBase *cssHelper)
TestObjectTreeSource(MessageViewer::HtmlWriter *writer, MessageViewer::CSSHelperBase *cssHelper)
: mWriter(writer)
, mCSSHelper(cssHelper)
, mHtmlLoadExternal(false)
{
}
MimeTreeParser::HtmlWriter *htmlWriter() override
MessageViewer::HtmlWriter *htmlWriter() override
{
return mWriter;
}
......@@ -87,9 +87,9 @@ public:
return QString();
}
const MimeTreeParser::AttachmentStrategy *attachmentStrategy() override
const MessageViewer::AttachmentStrategy *attachmentStrategy() override
{
return MimeTreeParser::AttachmentStrategy::smart();
return MessageViewer::AttachmentStrategy::smart();
}
bool autoImportKeys() const override
......@@ -113,7 +113,7 @@ public:
}
private:
MimeTreeParser::HtmlWriter *mWriter = nullptr;
MessageViewer::HtmlWriter *mWriter = nullptr;
MessageViewer::CSSHelperBase *mCSSHelper = nullptr;
bool mHtmlLoadExternal;
};
......
......@@ -45,7 +45,7 @@
#include <MessageViewer/MessagePartRenderPlugin>
#include <MessageViewer/MessageViewerSettings>
#include <MessageViewer/Viewer>
#include <MimeTreeParser/HtmlWriter>
#include <MessageViewer/HtmlWriter>
#include <MimeTreeParser/BodyPart>
#include <MimeTreeParser/MessagePart>
using namespace MessageViewer;
......@@ -183,7 +183,7 @@ private:
class Formatter : public MessageViewer::MessagePartRendererBase
{
public:
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *writer, MessageViewer::RenderContext *) const override
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MessageViewer::HtmlWriter *writer, MessageViewer::RenderContext *) const override
{
QMimeDatabase db;
auto mt = db.mimeTypeForName(QString::fromLatin1(msgPart->content()->contentType()->mimeType().toLower()));
......
......@@ -27,7 +27,7 @@
#include <QUrlQuery>
#include <MimeTreeParser/BodyPart>
#include <MimeTreeParser/HtmlWriter>
#include <MessageViewer/HtmlWriter>
#include <MimeTreeParser/NodeHelper>
#include <MimeTreeParser/MessagePart>
#include <MessageCore/MessageCoreUtil>
......@@ -85,7 +85,7 @@ MessagePart::Ptr ApplicationGnuPGWKSFormatter::process(BodyPart &part) const
return {};
}
bool ApplicationGnuPGWKSFormatter::render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const
bool ApplicationGnuPGWKSFormatter::render(const MimeTreeParser::MessagePartPtr &msgPart, MessageViewer::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const
{
Q_UNUSED(context);
auto mp = msgPart.dynamicCast<GnuPGWKSMessagePart>();
......
......@@ -32,7 +32,7 @@ public:
ApplicationGnuPGWKSFormatter() = default;
MimeTreeParser::MessagePartPtr process(MimeTreeParser::Interface::BodyPart &part) const override;
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const override;
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MessageViewer::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const override;
private:
enum WKSStatus {
......
......@@ -24,7 +24,7 @@
#include <QApplication>
#include <QPalette>
#include <MimeTreeParser/HtmlWriter>
#include <MessageViewer/HtmlWriter>
#include <MimeTreeParser/MessagePart>
#include <GrantleeTheme/GrantleeThemeEngine>
......@@ -65,7 +65,7 @@ MimeTreeParser::MessagePartPtr ApplicationPGPKeyFormatter::process(MimeTreeParse
return MimeTreeParser::MessagePartPtr(mp);
}
bool ApplicationPGPKeyFormatter::render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const
bool ApplicationPGPKeyFormatter::render(const MimeTreeParser::MessagePartPtr &msgPart, MessageViewer::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const
{
Q_UNUSED(context);
auto mp = msgPart.dynamicCast<PgpKeyMessagePart>();
......
......@@ -31,7 +31,7 @@ public:
ApplicationPGPKeyFormatter() = default;
MimeTreeParser::MessagePartPtr process(MimeTreeParser::Interface::BodyPart &part) const override;
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const override;
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MessageViewer::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const override;
private:
QString render(const PgpKeyMessagePart &mp) const;
......
......@@ -36,7 +36,7 @@
#include <MessageViewer/MessagePartRenderPlugin>
#include <MimeTreeParser/MessagePart>
#include <MimeTreeParser/HtmlWriter>
#include <MessageViewer/HtmlWriter>
#include <KSyntaxHighlighting/Definition>
#include <KSyntaxHighlighting/Repository>
......@@ -52,11 +52,11 @@ namespace {
class Formatter : public MessageViewer::MessagePartRendererBase
{
public:
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const override
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MessageViewer::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const override
{
Q_UNUSED(context);
auto mp = msgPart.dynamicCast<MimeTreeParser::AttachmentMessagePart>();
if (!mp || mp->isHidden() || mp->text().isEmpty() || mp->asIcon() != MimeTreeParser::NoIcon) {
if (!mp || context->isHiddenHint(msgPart) || mp->text().isEmpty() || context->displayHint(msgPart) != MimeTreeParser::NoIcon) {
return false;
}
......@@ -76,6 +76,7 @@ public:
auto c = MessageViewer::MessagePartRendererManager::self()->createContext();
c.insert(QStringLiteral("block"), msgPart.data());
c.insert(QStringLiteral("showOnlyOneMimePart"), context->showOnlyOneMimePart());
c.insert(QStringLiteral("content"), QVariant::fromValue<MessageViewer::GrantleeCallback>([=](Grantlee::OutputStream *) {
Highlighter highLighter(htmlWriter->stream());
highLighter.setDefinition(def);
......
......@@ -37,7 +37,7 @@
#include <MessageCore/StringUtil>
#include <MimeTreeParser/HtmlWriter>
#include <MessageViewer/HtmlWriter>
#include <MimeTreeParser/MessagePart>
#include <MimeTreeParser/NodeHelper>
......@@ -65,11 +65,11 @@ namespace {
class Formatter : public MessageViewer::MessagePartRendererBase
{
public:
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const override
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MessageViewer::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const override
{
Q_UNUSED(context);
auto mp = msgPart.dynamicCast<MimeTreeParser::AttachmentMessagePart>();
if (!mp || mp->isHidden()) {
if (!mp || context->isHiddenHint(msgPart)) {
return false;
}
......@@ -109,9 +109,9 @@ public:
}
}
mp->setShowTextFrame(true);
auto c = MessageViewer::MessagePartRendererManager::self()->createContext();
c.insert(QStringLiteral("block"), msgPart.data());
c.insert(QStringLiteral("showOnlyOneMimePart"), context->showOnlyOneMimePart());
c.insert(QStringLiteral("content"), QVariant::fromValue<MessageViewer::GrantleeCallback>([&](Grantlee::OutputStream *stream) {
const auto tnefatts = parser.message()->attachmentList();
if (tnefatts.isEmpty() && inviteStr.isEmpty()) {
......
......@@ -24,7 +24,7 @@
#include <MessageViewer/MessagePartRendererManager>
#include <MessageViewer/MessagePartRenderPlugin>
#include <MimeTreeParser/HtmlWriter>
#include <MessageViewer/HtmlWriter>
#include <MimeTreeParser/MessagePart>
#include <grantlee/metatype.h>
......@@ -48,11 +48,11 @@ namespace {
class Formatter : public MessageViewer::MessagePartRendererBase
{
public:
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const override
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MessageViewer::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const override
{
Q_UNUSED(context);
auto mp = msgPart.dynamicCast<MimeTreeParser::AttachmentMessagePart>();
if (!mp || mp->isHidden()) {
if (!mp || context->isHiddenHint(msgPart)) {
return false;
}
......
......@@ -23,7 +23,7 @@
#include "semantic_debug.h"
#include <MessageViewer/MessagePartRendererManager>
#include <MimeTreeParser/HtmlWriter>
#include <MessageViewer/HtmlWriter>
#include <grantlee/metatype.h>
#include <grantlee/template.h>
......@@ -62,7 +62,7 @@ SemanticRenderer::SemanticRenderer()
Grantlee::registerMetaType<PostalAddress>();
}
bool SemanticRenderer::render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const
bool SemanticRenderer::render(const MimeTreeParser::MessagePartPtr &msgPart, MessageViewer::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const
{
Q_UNUSED(context);
const auto mpList = msgPart.dynamicCast<MimeTreeParser::MessagePartList>();
......
......@@ -27,7 +27,7 @@ class SemanticRenderer : public MessageViewer::MessagePartRendererBase
{
public:
SemanticRenderer();
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const override;
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MessageViewer::HtmlWriter *htmlWriter, MessageViewer::RenderContext *context) const override;
};
#endif // SEMANTICRENDERER_H
......@@ -43,7 +43,7 @@
#include <MessageViewer/MessagePartRenderPlugin>
#include <MimeTreeParser/BodyPart>
#include <MimeTreeParser/HtmlWriter>
#include <MessageViewer/HtmlWriter>
#include <MimeTreeParser/MessagePart>
#include <MimeTreeParser/NodeHelper>
using MimeTreeParser::Interface::BodyPart;
......@@ -70,7 +70,7 @@ class Formatter : public MessageViewer::MessagePartRendererBase
public:
Formatter() = default;
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *writer, MessageViewer::RenderContext *) const override
bool render(const MimeTreeParser::MessagePartPtr &msgPart, MessageViewer::HtmlWriter *writer, MessageViewer::RenderContext *) const override
{
QMimeDatabase db;
auto mt = db.mimeTypeForName(QString::fromLatin1(msgPart->content()->contentType()->mimeType().toLower()));
......
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