summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandro Knauß <[email protected]>2017-10-31 14:24:34 +0100
committerSandro Knauß <[email protected]>2017-11-14 15:43:31 +0100
commit14891a095a28c2d85811a943737e6108db98bd74 (patch)
treefd02bec26cb58c5bf6cd6575dad7562563fd0929
parent6f849b1bab38fb38f2bb94892f305a762e6917ba (diff)
move HtmlWriter from MimeTreeParser->MessageViewer
Test Plan: run tests of messagelib and kdepim-addons Reviewers: vkrause Subscribers: #kde_pim Tags: #kde_pim Differential Revision: https://phabricator.kde.org/D8575
-rw-r--r--messagecomposer/autotests/cryptocomposertest.cpp6
-rw-r--r--messagecomposer/autotests/cryptofunctions.cpp13
-rw-r--r--messagecomposer/autotests/messagefactoryngtest.cpp1
-rw-r--r--messagecomposer/autotests/setupenv.h10
-rw-r--r--messageviewer/src/CMakeLists.txt25
-rw-r--r--messageviewer/src/htmlwriter/bufferedhtmlwriter.cpp (renamed from mimetreeparser/src/htmlwriter/bufferedhtmlwriter.cpp)2
-rw-r--r--messageviewer/src/htmlwriter/bufferedhtmlwriter.h (renamed from mimetreeparser/src/htmlwriter/bufferedhtmlwriter.h)14
-rw-r--r--messageviewer/src/htmlwriter/filehtmlwriter.cpp (renamed from mimetreeparser/src/htmlwriter/filehtmlwriter.cpp)10
-rw-r--r--messageviewer/src/htmlwriter/filehtmlwriter.h (renamed from mimetreeparser/src/htmlwriter/filehtmlwriter.h)16
-rw-r--r--messageviewer/src/htmlwriter/webengineparthtmlwriter.h4
-rw-r--r--messageviewer/src/interfaces/htmlwriter.cpp (renamed from mimetreeparser/src/interfaces/htmlwriter.cpp)2
-rw-r--r--messageviewer/src/interfaces/htmlwriter.h (renamed from mimetreeparser/src/interfaces/htmlwriter.h)12
-rw-r--r--messageviewer/src/messagepartthemes/default/autotests/objecttreeparsertest.cpp26
-rw-r--r--messageviewer/src/messagepartthemes/default/autotests/quotehtmltest.cpp4
-rw-r--r--messageviewer/src/messagepartthemes/default/autotests/rendertest.cpp4
-rw-r--r--messageviewer/src/messagepartthemes/default/autotests/setupenv.h6
-rw-r--r--messageviewer/src/messagepartthemes/default/autotests/unencryptedmessagetest.cpp10
-rw-r--r--messageviewer/src/messagepartthemes/default/autotests/util.h2
-rw-r--r--messageviewer/src/messagepartthemes/default/defaultrenderer.cpp4
-rw-r--r--messageviewer/src/messagepartthemes/default/defaultrenderer.h4
-rw-r--r--messageviewer/src/messagepartthemes/default/defaultrenderer_p.h27
-rw-r--r--messageviewer/src/messagepartthemes/default/htmlblock.cpp4
-rw-r--r--messageviewer/src/messagepartthemes/default/htmlblock.h6
-rw-r--r--messageviewer/src/messagepartthemes/default/messagepartrendererbase.h15
-rw-r--r--messageviewer/src/messagepartthemes/default/plugins/attachmentmessagepartrenderer.cpp4
-rw-r--r--messageviewer/src/messagepartthemes/default/plugins/attachmentmessagepartrenderer.h2
-rw-r--r--messageviewer/src/messagepartthemes/default/plugins/messagepartrenderer.cpp6
-rw-r--r--messageviewer/src/messagepartthemes/default/plugins/messagepartrenderer.h2
-rw-r--r--messageviewer/src/messagepartthemes/default/plugins/textmessagepartrenderer.cpp4
-rw-r--r--messageviewer/src/messagepartthemes/default/plugins/textmessagepartrenderer.h2
-rw-r--r--messageviewer/src/viewer/objecttreeemptysource.cpp12
-rw-r--r--messageviewer/src/viewer/objecttreeemptysource.h5
-rw-r--r--messageviewer/src/viewer/objecttreeviewersource.cpp6
-rw-r--r--messageviewer/src/viewer/objecttreeviewersource.h5
-rw-r--r--messageviewer/src/viewer/viewer_p.cpp4
-rw-r--r--messageviewer/src/viewer/viewer_p.h12
-rw-r--r--mimetreeparser/autotests/attachmenttest.cpp2
-rw-r--r--mimetreeparser/autotests/setupenv.h16
-rw-r--r--mimetreeparser/src/CMakeLists.txt19
-rw-r--r--mimetreeparser/src/bodypartformatter.cpp7
-rw-r--r--mimetreeparser/src/interfaces/objecttreesource.h6
-rw-r--r--mimetreeparser/src/objecttreeparser.cpp17
-rw-r--r--mimetreeparser/src/objecttreeparser.h6
43 files changed, 163 insertions, 201 deletions
diff --git a/messagecomposer/autotests/cryptocomposertest.cpp b/messagecomposer/autotests/cryptocomposertest.cpp
index 7e3c463..eb1f953 100644
--- a/messagecomposer/autotests/cryptocomposertest.cpp
+++ b/messagecomposer/autotests/cryptocomposertest.cpp
@@ -49,7 +49,6 @@ using namespace MessageComposer;
#include <setupenv.h>
#include <MimeTreeParser/ObjectTreeParser>
-#include <MimeTreeParser/BufferedHtmlWriter>
using MessageCore::AttachmentPart;
@@ -153,17 +152,14 @@ void CryptoComposerTest::testEncryptSameAttachments()
QCOMPARE(message->from()->asUnicodeString(), QString::fromLocal8Bit("[email protected]"));
QCOMPARE(message->to()->asUnicodeString(), QString::fromLocal8Bit("[email protected]"));
- MimeTreeParser::BufferedHtmlWriter testWriter;
- testWriter.begin();
TestCSSHelper testCSSHelper;
- MessageComposer::Test::TestObjectTreeSource testSource(&testWriter, &testCSSHelper);
+ MessageComposer::Test::TestObjectTreeSource testSource(&testCSSHelper);
testSource.setAllowDecryption(true);
MimeTreeParser::NodeHelper *nh = new MimeTreeParser::NodeHelper;
MimeTreeParser::ObjectTreeParser otp(&testSource, nh);
MimeTreeParser::ProcessResult pResult(nh);
otp.parseObjectTree(message.data());
- testWriter.end();
KMime::Message::Ptr unencrypted = nh->unencryptedMessage(message);
KMime::Content *testAttachment = Util::findTypeInMessage(unencrypted.data(), "x-some", "x-type");
diff --git a/messagecomposer/autotests/cryptofunctions.cpp b/messagecomposer/autotests/cryptofunctions.cpp
index f17fa3c..2afa3db 100644
--- a/messagecomposer/autotests/cryptofunctions.cpp
+++ b/messagecomposer/autotests/cryptofunctions.cpp
@@ -31,7 +31,6 @@
#include <MessageViewer/CSSHelper>
#include <MessageViewer/ObjectTreeEmptySource>
#include <MimeTreeParser/ObjectTreeParser>
-#include <MimeTreeParser/BufferedHtmlWriter>
#include <MessageCore/NodeHelper>
@@ -61,10 +60,8 @@ void ComposerTestUtil::verifySignature(KMime::Content *content, const QByteArray
resultMessage->parse();
// parse the result and make sure it is valid in various ways
- MimeTreeParser::BufferedHtmlWriter testWriter;
- testWriter.begin();
TestCSSHelper testCSSHelper;
- MessageComposer::Test::TestObjectTreeSource testSource(&testWriter, &testCSSHelper);
+ MessageComposer::Test::TestObjectTreeSource testSource(&testCSSHelper);
MimeTreeParser::NodeHelper *nh = new MimeTreeParser::NodeHelper;
MimeTreeParser::ObjectTreeParser otp(&testSource, nh);
MimeTreeParser::ProcessResult pResult(nh);
@@ -134,10 +131,8 @@ void ComposerTestUtil::verifyEncryption(KMime::Content *content, const QByteArra
resultMessage->parse();
// parse the result and make sure it is valid in various ways
- MimeTreeParser::BufferedHtmlWriter testWriter;
- testWriter.begin();
TestCSSHelper testCSSHelper;
- MessageComposer::Test::TestObjectTreeSource testSource(&testWriter, &testCSSHelper);
+ MessageComposer::Test::TestObjectTreeSource testSource(&testCSSHelper);
testSource.setAllowDecryption(true);
MimeTreeParser::NodeHelper *nh = new MimeTreeParser::NodeHelper;
MimeTreeParser::ObjectTreeParser otp(&testSource, nh);
@@ -190,10 +185,8 @@ void ComposerTestUtil::verifySignatureAndEncryption(KMime::Content *content, con
resultMessage->parse();
// parse the result and make sure it is valid in various ways
- MimeTreeParser::BufferedHtmlWriter testWriter;
- testWriter.begin();
TestCSSHelper testCSSHelper;
- MessageComposer::Test::TestObjectTreeSource testSource(&testWriter, &testCSSHelper);
+ MessageComposer::Test::TestObjectTreeSource testSource(&testCSSHelper);
testSource.setAllowDecryption(true);
MimeTreeParser::NodeHelper *nh = new MimeTreeParser::NodeHelper;
MimeTreeParser::ObjectTreeParser otp(&testSource, nh);
diff --git a/messagecomposer/autotests/messagefactoryngtest.cpp b/messagecomposer/autotests/messagefactoryngtest.cpp
index dc08a9e..93938c3 100644
--- a/messagecomposer/autotests/messagefactoryngtest.cpp
+++ b/messagecomposer/autotests/messagefactoryngtest.cpp
@@ -38,7 +38,6 @@
#include "testcsshelper.h"
#include <setupenv.h>
-#include <MimeTreeParser/BufferedHtmlWriter>
#include <MimeTreeParser/NodeHelper>
#include <MimeTreeParser/ObjectTreeParser>
diff --git a/messagecomposer/autotests/setupenv.h b/messagecomposer/autotests/setupenv.h
index d570d61..1367b41 100644
--- a/messagecomposer/autotests/setupenv.h
+++ b/messagecomposer/autotests/setupenv.h
@@ -47,15 +47,14 @@ std::vector<GpgME::Key> getKeys(bool smime = false);
class TestObjectTreeSource : public MessageViewer::EmptySource
{
public:
- TestObjectTreeSource(MimeTreeParser::HtmlWriter *writer, MessageViewer::CSSHelperBase *cssHelper)
- : mWriter(writer)
- , mCSSHelper(cssHelper)
+ TestObjectTreeSource(MessageViewer::CSSHelperBase *cssHelper)
+ : mCSSHelper(cssHelper)
{
}
- MimeTreeParser::HtmlWriter *htmlWriter() override
+ MessageViewer::HtmlWriter *htmlWriter() override
{
- return mWriter;
+ return nullptr;
}
MessageViewer::CSSHelperBase *cssHelper() override
@@ -64,7 +63,6 @@ public:
}
private:
- MimeTreeParser::HtmlWriter *mWriter = nullptr;
MessageViewer::CSSHelperBase *mCSSHelper = nullptr;
};
}
diff --git a/messageviewer/src/CMakeLists.txt b/messageviewer/src/CMakeLists.txt
index d88772a..74f390e 100644
--- a/messageviewer/src/CMakeLists.txt
+++ b/messageviewer/src/CMakeLists.txt
@@ -135,6 +135,12 @@ set(libmessageviewer_htmlwriter_webengine_SRCS
htmlwriter/webengineembedpart.cpp
)
+set(libmessageviewer_htmlwriter_SRCS
+ ${libmessageviewer_htmlwriter_webengine_SRCS}
+ htmlwriter/bufferedhtmlwriter.cpp
+ htmlwriter/filehtmlwriter.cpp
+ )
+
set(libmessageviewer_antispam_SRCS
antispam/spamheaderanalyzer.cpp
antispam/antispamconfig.cpp
@@ -166,9 +172,13 @@ set(libmessageviewer_messagepartthemes_default_SRCS
messagepartthemes/default/messagepartrendererfactory.cpp
)
+set(libmessageviewer_interfaces_SRCS
+ interfaces/htmlwriter.cpp
+ )
+
set(libmessageviewer_SRCS
${libmessageviewer_messagepartthemes_default_SRCS}
- ${libmessageviewer_htmlwriter_webengine_SRCS}
+ ${libmessageviewer_htmlwriter_SRCS}
${libmessageviewer_messagepartthemes_SRCS}
${libmessageviewer_scamdetection_webengine_SRCS}
${libmessageviewer_widgets_webengine_SRCS}
@@ -183,6 +193,7 @@ set(libmessageviewer_SRCS
${libmessageviewer_viewerplugins_SRCS}
settings/messageviewersettings.cpp
${libmessageviewer_mailviewer_SRCS}
+ ${libmessageviewer_interfaces_SRCS}
)
qt5_add_resources(libmessageviewer_SRCS messagepartthemes.qrc)
@@ -318,6 +329,7 @@ ecm_generate_headers(MessageViewer_Camelcaseantispam_HEADERS
ecm_generate_headers(MessageViewer_Camelcaseinterfaces_HEADERS
HEADER_NAMES
+ HtmlWriter
BodyPartURLHandler
URLHandler
REQUIRED_HEADERS MessageViewer_interfaces_HEADERS
@@ -325,6 +337,15 @@ ecm_generate_headers(MessageViewer_Camelcaseinterfaces_HEADERS
RELATIVE interfaces
)
+ecm_generate_headers(MessageViewer_Camelcasehtmlwriter_HEADERS
+ HEADER_NAMES
+ BufferedHtmlWriter
+ FileHtmlWriter
+ REQUIRED_HEADERS MessageViewer_htmlwriter_HEADERS
+ PREFIX MessageViewer
+ RELATIVE htmlwriter
+ )
+
ecm_generate_headers(MessageViewer_Camelcasesettings_HEADERS
HEADER_NAMES
MessageViewerSettings
@@ -388,6 +409,7 @@ install(FILES
${MessageViewer_Camelcasesettings_HEADERS}
${MessageViewer_Camelcaseutils_HEADERS}
${MessageViewer_Camelcaseinterfaces_HEADERS}
+ ${MessageViewer_Camelcasehtmlwriter_HEADERS}
${MessageViewer_Camelcaseviewer_HEADERS}
${MessageViewer_Camelcasewidgets_HEADERS}
${MessageViewer_Camelcaseantispam_HEADERS}
@@ -406,6 +428,7 @@ install(FILES
${MessageViewer_header_HEADERS}
${MessageViewer_utils_HEADERS}
${MessageViewer_interfaces_HEADERS}
+ ${MessageViewer_htmlwriter_HEADERS}
${MessageViewer_HEADERS}
${MessageViewer_viewer_HEADERS}
${MessageViewer_widgets_HEADERS}
diff --git a/mimetreeparser/src/htmlwriter/bufferedhtmlwriter.cpp b/messageviewer/src/htmlwriter/bufferedhtmlwriter.cpp
index 020e28a..420bf8a 100644
--- a/mimetreeparser/src/htmlwriter/bufferedhtmlwriter.cpp
+++ b/messageviewer/src/htmlwriter/bufferedhtmlwriter.cpp
@@ -19,7 +19,7 @@
#include "bufferedhtmlwriter.h"
-using namespace MimeTreeParser;
+using namespace MessageViewer;
BufferedHtmlWriter::BufferedHtmlWriter()
: m_buffer(&m_data)
diff --git a/mimetreeparser/src/htmlwriter/bufferedhtmlwriter.h b/messageviewer/src/htmlwriter/bufferedhtmlwriter.h
index 301f906..abaa9b8 100644
--- a/mimetreeparser/src/htmlwriter/bufferedhtmlwriter.h
+++ b/messageviewer/src/htmlwriter/bufferedhtmlwriter.h
@@ -17,20 +17,20 @@
02110-1301, USA.
*/
-#ifndef MIMETREEPARSER_BUFFEREDHTMLWRITER_H
-#define MIMETREEPARSER_BUFFEREDHTMLWRITER_H
+#ifndef MESSAGEVIEWER_BUFFEREDHTMLWRITER_H
+#define MESSAGEVIEWER_BUFFEREDHTMLWRITER_H
-#include "mimetreeparser_export.h"
-#include <mimetreeparser/htmlwriter.h>
+#include "messageviewer_export.h"
+#include <MessageViewer/HtmlWriter>
#include <QBuffer>
#include <QByteArray>
-namespace MimeTreeParser {
+namespace MessageViewer {
/**
* QBuffer-backed HtmlWriter
*/
-class MIMETREEPARSER_EXPORT BufferedHtmlWriter : public HtmlWriter
+class MESSAGEVIEWER_EXPORT BufferedHtmlWriter : public HtmlWriter
{
public:
BufferedHtmlWriter();
@@ -55,4 +55,4 @@ private:
};
}
-#endif // MIMETREEPARSER_BUFFEREDHTMLWRITER_H
+#endif // MESSAGEVIEWER_BUFFEREDHTMLWRITER_H
diff --git a/mimetreeparser/src/htmlwriter/filehtmlwriter.cpp b/messageviewer/src/htmlwriter/filehtmlwriter.cpp
index eda5351..5efbeae 100644
--- a/mimetreeparser/src/htmlwriter/filehtmlwriter.cpp
+++ b/messageviewer/src/htmlwriter/filehtmlwriter.cpp
@@ -30,9 +30,9 @@
*/
#include "filehtmlwriter.h"
-#include "mimetreeparser_debug.h"
+#include "messageviewer_debug.h"
-using namespace MimeTreeParser;
+using namespace MessageViewer;
FileHtmlWriter::FileHtmlWriter(const QString &filename)
: mFile(filename.isEmpty() ? QStringLiteral("filehtmlwriter.out") : filename)
@@ -42,7 +42,7 @@ FileHtmlWriter::FileHtmlWriter(const QString &filename)
FileHtmlWriter::~FileHtmlWriter()
{
if (mFile.isOpen()) {
- qCWarning(MIMETREEPARSER_LOG) << "FileHtmlWriter: file still open!";
+ qCWarning(MESSAGEVIEWER_LOG) << "FileHtmlWriter: file still open!";
HtmlWriter::end();
mFile.close();
}
@@ -51,11 +51,11 @@ FileHtmlWriter::~FileHtmlWriter()
void FileHtmlWriter::begin()
{
if (mFile.isOpen()) {
- qCWarning(MIMETREEPARSER_LOG) << "FileHtmlWriter: file still open!";
+ qCWarning(MESSAGEVIEWER_LOG) << "FileHtmlWriter: file still open!";
mFile.close();
}
if (!mFile.open(QIODevice::WriteOnly)) {
- qCWarning(MIMETREEPARSER_LOG) << "FileHtmlWriter: Cannot open file" << mFile.fileName();
+ qCWarning(MESSAGEVIEWER_LOG) << "FileHtmlWriter: Cannot open file" << mFile.fileName();
}
HtmlWriter::begin();
}
diff --git a/mimetreeparser/src/htmlwriter/filehtmlwriter.h b/messageviewer/src/htmlwriter/filehtmlwriter.h
index 4cf16f3..9a50c14 100644
--- a/mimetreeparser/src/htmlwriter/filehtmlwriter.h
+++ b/messageviewer/src/htmlwriter/filehtmlwriter.h
@@ -29,16 +29,16 @@
your version.
*/
-#ifndef __MIMETREEPARSER_FILEHTMLWRITER_H__
-#define __MIMETREEPARSER_FILEHTMLWRITER_H__
+#ifndef __MESSAGEVIEWER_FILEHTMLWRITER_H__
+#define __MESSAGEVIEWER_FILEHTMLWRITER_H__
-#include "mimetreeparser_export.h"
-#include "mimetreeparser/htmlwriter.h"
+#include "messageviewer_export.h"
+#include <MessageViewer/HtmlWriter>
#include <QFile>
-namespace MimeTreeParser {
-class MIMETREEPARSER_EXPORT FileHtmlWriter : public HtmlWriter
+namespace MessageViewer {
+class MESSAGEVIEWER_EXPORT FileHtmlWriter : public HtmlWriter
{
public:
explicit FileHtmlWriter(const QString &filename);
@@ -54,6 +54,6 @@ public:
private:
QFile mFile;
};
-} // namespace MimeTreeParser
+} // namespace MessageViewer
-#endif // __MIMETREEPARSER_FILEHTMLWRITER_H__
+#endif // __MESSAGEVIEWER_FILEHTMLWRITER_H__
diff --git a/messageviewer/src/htmlwriter/webengineparthtmlwriter.h b/messageviewer/src/htmlwriter/webengineparthtmlwriter.h
index f163c96..791e8ee 100644
--- a/messageviewer/src/htmlwriter/webengineparthtmlwriter.h
+++ b/messageviewer/src/htmlwriter/webengineparthtmlwriter.h
@@ -17,7 +17,7 @@
#ifndef WEBENGINEPARTHTMLWRITER_H
#define WEBENGINEPARTHTMLWRITER_H
-#include <MimeTreeParser/BufferedHtmlWriter>
+#include "bufferedhtmlwriter.h"
#include <QObject>
#include <QString>
@@ -28,7 +28,7 @@ class MailWebEngineView;
}
namespace MessageViewer {
-class WebEnginePartHtmlWriter : public QObject, public MimeTreeParser::BufferedHtmlWriter
+class WebEnginePartHtmlWriter : public QObject, public BufferedHtmlWriter
{
Q_OBJECT
public:
diff --git a/mimetreeparser/src/interfaces/htmlwriter.cpp b/messageviewer/src/interfaces/htmlwriter.cpp
index acbf6de..bf4494f 100644
--- a/mimetreeparser/src/interfaces/htmlwriter.cpp
+++ b/messageviewer/src/interfaces/htmlwriter.cpp
@@ -21,7 +21,7 @@
#include <QTextStream>
-using namespace MimeTreeParser;
+using namespace MessageViewer;
HtmlWriter::HtmlWriter() = default;
HtmlWriter::~HtmlWriter() = default;
diff --git a/mimetreeparser/src/interfaces/htmlwriter.h b/messageviewer/src/interfaces/htmlwriter.h
index 8fcddcd..c10e8c4 100644
--- a/mimetreeparser/src/interfaces/htmlwriter.h
+++ b/messageviewer/src/interfaces/htmlwriter.h
@@ -30,10 +30,10 @@
your version.
*/
-#ifndef __MIMETREEPARSER_INTERFACES_HTMLWRITER_H__
-#define __MIMETREEPARSER_INTERFACES_HTMLWRITER_H__
+#ifndef __MESSAGEVIEWER_INTERFACES_HTMLWRITER_H__
+#define __MESSAGEVIEWER_INTERFACES_HTMLWRITER_H__
-#include "mimetreeparser_export.h"
+#include "messageviewer_export.h"
#include <qglobal.h>
#include <memory>
@@ -43,13 +43,13 @@ class QIODevice;
class QString;
class QTextStream;
-namespace MimeTreeParser {
+namespace MessageViewer {
/**
* @short An interface for HTML sinks.
* @author Marc Mutz <[email protected]>
*
*/
-class MIMETREEPARSER_EXPORT HtmlWriter
+class MESSAGEVIEWER_EXPORT HtmlWriter
{
public:
HtmlWriter();
@@ -102,4 +102,4 @@ private:
};
}
-#endif // __MIMETREEPARSER_INTERFACES_HTMLWRITER_H__
+#endif // __MESSAGEVIEWER_INTERFACES_HTMLWRITER_H__
diff --git a/messageviewer/src/messagepartthemes/default/autotests/objecttreeparsertest.cpp b/messageviewer/src/messagepartthemes/default/autotests/objecttreeparsertest.cpp
index f1b377c..9db9379 100644
--- a/messageviewer/src/messagepartthemes/default/autotests/objecttreeparsertest.cpp
+++ b/messageviewer/src/messagepartthemes/default/autotests/objecttreeparsertest.cpp
@@ -21,7 +21,7 @@
#include "setupenv.h"
#include <MimeTreeParser/ObjectTreeParser>
-#include <MimeTreeParser/BufferedHtmlWriter>
+#include <MessageViewer/BufferedHtmlWriter>
#include <MessageViewer/CSSHelperBase>
#include <QTest>
@@ -92,7 +92,7 @@ void ObjectTreeParserTester::test_parseEncapsulatedMessage()
QCOMPARE(msg->contents().size(), 2);
// Parse the message
- MimeTreeParser::BufferedHtmlWriter testWriter;
+ BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
NodeHelper nodeHelper;
@@ -130,7 +130,7 @@ void ObjectTreeParserTester::test_missingContentTypeHeader()
false).constData(), "Simple Mail Without Content-Type Header");
QCOMPARE(msg->contents().size(), 0);
- MimeTreeParser::BufferedHtmlWriter testWriter;
+ BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
NodeHelper nodeHelper;
@@ -150,7 +150,7 @@ void ObjectTreeParserTester::test_inlinePGPDecryption()
QCOMPARE(msg->subject()->as7BitString(false).constData(), "inlinepgpencrypted");
QCOMPARE(msg->contents().size(), 0);
- MimeTreeParser::BufferedHtmlWriter testWriter;
+ BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
NodeHelper nodeHelper;
@@ -177,7 +177,7 @@ void ObjectTreeParserTester::test_inlinePGPSigned()
QCOMPARE(msg->subject()->as7BitString(false).constData(), "test");
QCOMPARE(msg->contents().size(), 0);
- MimeTreeParser::BufferedHtmlWriter testWriter;
+ BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
NodeHelper nodeHelper;
@@ -217,7 +217,7 @@ void ObjectTreeParserTester::test_HTMLasText()
QCOMPARE(msg->subject()->as7BitString(false).constData(), "HTML test");
QCOMPARE(msg->contents().size(), 2);
- MimeTreeParser::BufferedHtmlWriter testWriter;
+ BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
@@ -255,7 +255,7 @@ void ObjectTreeParserTester::test_HTMLOnlyText()
QCOMPARE(msg->subject()->as7BitString(false).constData(), "HTML test");
QCOMPARE(msg->contents().size(), 0);
- MimeTreeParser::BufferedHtmlWriter testWriter;
+ BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
@@ -279,7 +279,7 @@ void ObjectTreeParserTester::test_HTMLExternal()
QCOMPARE(msg->contents().size(), 0);
{
- MimeTreeParser::BufferedHtmlWriter testWriter;
+ BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
@@ -294,7 +294,7 @@ void ObjectTreeParserTester::test_HTMLExternal()
QVERIFY(testWriter.data().contains("This HTML message may contain external references to images etc. For security/privacy reasons external references are not loaded."));
}
{
- MimeTreeParser::BufferedHtmlWriter testWriter;
+ BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
@@ -315,7 +315,7 @@ void ObjectTreeParserTester::test_Alternative()
KMime::Message::Ptr msg = Test::readAndParseMail(QStringLiteral("alternative.mbox"));
QCOMPARE(msg->contents().size(), 2);
{
- MimeTreeParser::BufferedHtmlWriter testWriter;
+ BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
@@ -332,7 +332,7 @@ void ObjectTreeParserTester::test_Alternative()
}
{
- MimeTreeParser::BufferedHtmlWriter testWriter;
+ BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
@@ -352,7 +352,7 @@ void ObjectTreeParserTester::test_Alternative()
msg = Test::readAndParseMail(QStringLiteral("alternative-notext.mbox"));
QCOMPARE(msg->contents().size(), 1);
{
- MimeTreeParser::BufferedHtmlWriter testWriter;
+ BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
@@ -368,7 +368,7 @@ void ObjectTreeParserTester::test_Alternative()
}
{
- MimeTreeParser::BufferedHtmlWriter testWriter;
+ BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
diff --git a/messageviewer/src/messagepartthemes/default/autotests/quotehtmltest.cpp b/messageviewer/src/messagepartthemes/default/autotests/quotehtmltest.cpp
index 04ea4f1..3865d8b 100644
--- a/messageviewer/src/messagepartthemes/default/autotests/quotehtmltest.cpp
+++ b/messageviewer/src/messagepartthemes/default/autotests/quotehtmltest.cpp
@@ -22,7 +22,7 @@
#include "setupenv.h"
#include <MimeTreeParser/ObjectTreeParser>
-#include <MimeTreeParser/BufferedHtmlWriter>
+#include <MessageViewer/BufferedHtmlWriter>
#include <MessageViewer/CSSHelperBase>
#include <MimeTreeParser/MessagePart>
#include <MessageViewer/IconNameCache>
@@ -138,7 +138,7 @@ void QuoteHtmlTest::testQuoteHtml()
QFETCH(QString, result);
QFETCH(bool, showExpandQuotesMark);
QFETCH(int, quotelevel);
- MimeTreeParser::BufferedHtmlWriter testWriter;
+ BufferedHtmlWriter testWriter;
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
emptySource.setShowExpandQuotesMark(showExpandQuotesMark);
diff --git a/messageviewer/src/messagepartthemes/default/autotests/rendertest.cpp b/messageviewer/src/messagepartthemes/default/autotests/rendertest.cpp
index b71bc3c..06f3a90 100644
--- a/messageviewer/src/messagepartthemes/default/autotests/rendertest.cpp
+++ b/messageviewer/src/messagepartthemes/default/autotests/rendertest.cpp
@@ -23,7 +23,7 @@
#include "testcsshelper.h"
#include "util.h"
-#include <MimeTreeParser/FileHtmlWriter>
+#include <MessageViewer/FileHtmlWriter>
#include <MimeTreeParser/ObjectTreeParser>
#include <MimeTreeParser/MessagePart>
@@ -311,7 +311,7 @@ void RenderTest::testRender()
const KMime::Message::Ptr msg(Test::readAndParseMail(mailFileName));
// render the mail
- MimeTreeParser::FileHtmlWriter fileWriter(outFileName);
+ FileHtmlWriter fileWriter(outFileName);
QImage paintDevice;
Test::TestCSSHelper cssHelper(&paintDevice);
MimeTreeParser::NodeHelper nodeHelper;
diff --git a/messageviewer/src/messagepartthemes/default/autotests/setupenv.h b/messageviewer/src/messagepartthemes/default/autotests/setupenv.h
index 0ee24d1..c8cb4a7 100644
--- a/messageviewer/src/messagepartthemes/default/autotests/setupenv.h
+++ b/messageviewer/src/messagepartthemes/default/autotests/setupenv.h
@@ -43,7 +43,7 @@ void setupEnv();
class ObjectTreeSource : public MessageViewer::EmptySource
{
public:
- ObjectTreeSource(MimeTreeParser::HtmlWriter *writer, MessageViewer::CSSHelperBase *cssHelper)
+ ObjectTreeSource(HtmlWriter *writer, MessageViewer::CSSHelperBase *cssHelper)
: mWriter(writer)
, mCSSHelper(cssHelper)
, mAttachmentStrategy(QStringLiteral("smart"))
@@ -56,7 +56,7 @@ public:
{
}
- MimeTreeParser::HtmlWriter *htmlWriter() override
+ HtmlWriter *htmlWriter() override
{
return mWriter;
}
@@ -169,7 +169,7 @@ public:
}
private:
- MimeTreeParser::HtmlWriter *mWriter;
+ HtmlWriter *mWriter;
MessageViewer::CSSHelperBase *mCSSHelper;
QString mAttachmentStrategy;
MimeTreeParser::BodyPartFormatterFactory mBodyPartFormatterFactory;
diff --git a/messageviewer/src/messagepartthemes/default/autotests/unencryptedmessagetest.cpp b/messageviewer/src/messagepartthemes/default/autotests/unencryptedmessagetest.cpp
index e9f0cde..435610d 100644
--- a/messageviewer/src/messagepartthemes/default/autotests/unencryptedmessagetest.cpp
+++ b/messageviewer/src/messagepartthemes/default/autotests/unencryptedmessagetest.cpp
@@ -24,7 +24,7 @@
#include <MimeTreeParser/NodeHelper>
#include <MimeTreeParser/ObjectTreeParser>
-#include <MimeTreeParser/BufferedHtmlWriter>
+#include <MessageViewer/BufferedHtmlWriter>
#include <QTest>
@@ -54,7 +54,7 @@ void UnencryptedMessageTest::testSignedForwardedOpenPGPSignedEncrypted()
= Test::readAndParseMail(QStringLiteral("signed-forward-openpgp-signed-encrypted.mbox"));
MimeTreeParser::NodeHelper nodeHelper;
- MimeTreeParser::BufferedHtmlWriter testWriter;
+ BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
@@ -78,7 +78,7 @@ void UnencryptedMessageTest::testForwardedOpenPGPSignedEncrypted()
= Test::readAndParseMail(QStringLiteral("forward-openpgp-signed-encrypted.mbox"));
MimeTreeParser::NodeHelper nodeHelper;
- MimeTreeParser::BufferedHtmlWriter testWriter;
+ BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
@@ -313,7 +313,7 @@ void UnencryptedMessageTest::testNotDecrypted()
KMime::Message::Ptr originalMessage = Test::readAndParseMail(mailFileName);
MimeTreeParser::NodeHelper nodeHelper;
- MimeTreeParser::BufferedHtmlWriter testWriter;
+ BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
@@ -338,7 +338,7 @@ void UnencryptedMessageTest::testSMimeAutoCertImport()
KMime::Message::Ptr originalMessage = Test::readAndParseMail(QStringLiteral("smime-cert.mbox"));
MimeTreeParser::NodeHelper nodeHelper;
- MimeTreeParser::BufferedHtmlWriter testWriter;
+ BufferedHtmlWriter testWriter;
testWriter.begin();
Test::CSSHelper testCSSHelper;
Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper);
diff --git a/messageviewer/src/messagepartthemes/default/autotests/util.h b/messageviewer/src/messagepartthemes/default/autotests/util.h
index df7808f..4e1ed41 100644
--- a/messageviewer/src/messagepartthemes/default/autotests/util.h
+++ b/messageviewer/src/messagepartthemes/default/autotests/util.h
@@ -20,7 +20,7 @@
#ifndef __MESSAGEVIEWER_TESTS_UTIL_H__
#define __MESSAGEVIEWER_TESTS_UTIL_H__
-#include <MimeTreeParser/HtmlWriter>
+#include "interfaces/htmlwriter.h"
#include <MessageViewer/CSSHelperBase>
#include <KMime/Message>
diff --git a/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp b/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp
index fa95930..096a5c3 100644
--- a/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp
+++ b/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp
@@ -34,7 +34,7 @@
#include "viewer/csshelperbase.h"
#include "messagepartrenderermanager.h"
-#include <MimeTreeParser/BufferedHtmlWriter>
+#include "htmlwriter/bufferedhtmlwriter.h"
#include <MimeTreeParser/MessagePart>
#include <MimeTreeParser/ObjectTreeParser>
#include <GrantleeTheme/QtResourceTemplateLoader>
@@ -1038,7 +1038,7 @@ void DefaultRenderer::setAttachmentStrategy(const AttachmentStrategy *strategy)
d->mAttachmentStrategy = strategy;
}
-void DefaultRenderer::render(const MimeTreeParser::MessagePart::Ptr &msgPart, MimeTreeParser::HtmlWriter *writer)
+void DefaultRenderer::render(const MimeTreeParser::MessagePart::Ptr &msgPart, HtmlWriter *writer)
{
d->mMsgPart = msgPart;
d->renderFactory(d->mMsgPart, writer);
diff --git a/messageviewer/src/messagepartthemes/default/defaultrenderer.h b/messageviewer/src/messagepartthemes/default/defaultrenderer.h
index 8663efb..759783c 100644
--- a/messageviewer/src/messagepartthemes/default/defaultrenderer.h
+++ b/messageviewer/src/messagepartthemes/default/defaultrenderer.h
@@ -24,12 +24,12 @@
namespace MimeTreeParser {
class DefaultRendererPrivate;
-class HtmlWriter;
class MessagePart;
typedef QSharedPointer<MessagePart> MessagePartPtr;
}
namespace MessageViewer {
+class HtmlWriter;
class AttachmentStrategy;
class CSSHelperBase;
@@ -41,7 +41,7 @@ public:
void setShowOnlyOneMimePart(bool onlyOneMimePart);
void setAttachmentStrategy(const AttachmentStrategy *strategy);
- void render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *writer);
+ void render(const MimeTreeParser::MessagePartPtr &msgPart, HtmlWriter *writer);
private:
MimeTreeParser::DefaultRendererPrivate *d;
};
diff --git a/messageviewer/src/messagepartthemes/default/defaultrenderer_p.h b/messageviewer/src/messagepartthemes/default/defaultrenderer_p.h
index 654bf79..c8b5545 100644
--- a/messageviewer/src/messagepartthemes/default/defaultrenderer_p.h
+++ b/messageviewer/src/messagepartthemes/default/defaultrenderer_p.h
@@ -35,6 +35,7 @@ class HtmlWriter;
}
namespace MimeTreeParser {
+
class DefaultRendererPrivate : public MessageViewer::RenderContext
{
public:
@@ -45,21 +46,21 @@ public:
Interface::ObjectTreeSource *source() const;
- void renderSubParts(const MessagePart::Ptr &msgPart, HtmlWriter *htmlWriter) override;
+ void renderSubParts(const MessagePart::Ptr &msgPart, MessageViewer::HtmlWriter *htmlWriter) override;
- void render(const MessagePartList::Ptr &mp, HtmlWriter *htmlWriter);
- void render(const MimeMessagePart::Ptr &mp, HtmlWriter *htmlWriter);
- void render(const EncapsulatedRfc822MessagePart::Ptr &mp, HtmlWriter *htmlWriter);
- void render(const HtmlMessagePart::Ptr &mp, HtmlWriter *htmlWriter);
- void renderEncrypted(const EncryptedMessagePart::Ptr &mp, HtmlWriter *htmlWriter);
- void renderSigned(const SignedMessagePart::Ptr &mp, HtmlWriter *htmlWriter);
- void render(const SignedMessagePart::Ptr &mp, HtmlWriter *htmlWriter);
- void render(const EncryptedMessagePart::Ptr &mp, HtmlWriter *htmlWriter);
- void render(const AlternativeMessagePart::Ptr &mp, HtmlWriter *htmlWriter);
- void render(const CertMessagePart::Ptr &mp, HtmlWriter *htmlWriter);
- bool renderWithFactory(const QMetaObject *mo, const MessagePart::Ptr &msgPart, HtmlWriter *writer) override;
+ void render(const MessagePartList::Ptr &mp, MessageViewer::HtmlWriter *htmlWriter);
+ void render(const MimeMessagePart::Ptr &mp, MessageViewer::HtmlWriter *htmlWriter);
+ void render(const EncapsulatedRfc822MessagePart::Ptr &mp, MessageViewer::HtmlWriter *htmlWriter);
+ void render(const HtmlMessagePart::Ptr &mp, MessageViewer::HtmlWriter *htmlWriter);
+ void renderEncrypted(const EncryptedMessagePart::Ptr &mp, MessageViewer::HtmlWriter *htmlWriter);
+ void renderSigned(const SignedMessagePart::Ptr &mp, MessageViewer::HtmlWriter *htmlWriter);
+ void render(const SignedMessagePart::Ptr &mp, MessageViewer::HtmlWriter *htmlWriter);
+ void render(const EncryptedMessagePart::Ptr &mp, MessageViewer::HtmlWriter *htmlWriter);
+ void render(const AlternativeMessagePart::Ptr &mp, MessageViewer::HtmlWriter *htmlWriter);
+ void render(const CertMessagePart::Ptr &mp, MessageViewer::HtmlWriter *htmlWriter);
+ bool renderWithFactory(const QMetaObject *mo, const MessagePart::Ptr &msgPart, MessageViewer::HtmlWriter *writer) override;
using RenderContext::renderWithFactory;
- void renderFactory(const MessagePart::Ptr &msgPart, HtmlWriter *htmlWriter);
+ void renderFactory(const MessagePart::Ptr &msgPart, MessageViewer::HtmlWriter *htmlWriter);
bool isHiddenHint(const MimeTreeParser::MessagePart::Ptr &msgPart) override;
MimeTreeParser::IconType displayHint(const MimeTreeParser::MessagePart::Ptr &msgPart) override;
diff --git a/messageviewer/src/messagepartthemes/default/htmlblock.cpp b/messageviewer/src/messagepartthemes/default/htmlblock.cpp
index c062fc1..d054e51 100644
--- a/messageviewer/src/messagepartthemes/default/htmlblock.cpp
+++ b/messageviewer/src/messagepartthemes/default/htmlblock.cpp
@@ -26,7 +26,7 @@
#include <QApplication>
-using namespace MimeTreeParser;
+using namespace MessageViewer;
HTMLBlock::HTMLBlock()
: entered(false)
@@ -60,7 +60,7 @@ QString HTMLBlock::exit()
return QString();
}
-AttachmentMarkBlock::AttachmentMarkBlock(MimeTreeParser::HtmlWriter *writer, KMime::Content *node)
+AttachmentMarkBlock::AttachmentMarkBlock(HtmlWriter *writer, KMime::Content *node)
: mNode(node)
, mWriter(writer)
{
diff --git a/messageviewer/src/messagepartthemes/default/htmlblock.h b/messageviewer/src/messagepartthemes/default/htmlblock.h
index a06cf3c..8ca8010 100644
--- a/messageviewer/src/messagepartthemes/default/htmlblock.h
+++ b/messageviewer/src/messagepartthemes/default/htmlblock.h
@@ -29,7 +29,7 @@ namespace KMime {
class Content;
}
-namespace MimeTreeParser {
+namespace MessageViewer {
class HtmlWriter;
class MESSAGEVIEWER_EXPORT HTMLBlock
@@ -58,7 +58,7 @@ private:
class MESSAGEVIEWER_EXPORT AttachmentMarkBlock : public HTMLBlock
{
public:
- AttachmentMarkBlock(MimeTreeParser::HtmlWriter *writer, KMime::Content *node);
+ AttachmentMarkBlock(HtmlWriter *writer, KMime::Content *node);
virtual ~AttachmentMarkBlock();
protected:
@@ -79,7 +79,7 @@ private:
class RootBlock : public HTMLBlock
{
public:
- RootBlock(MimeTreeParser::HtmlWriter *writer);
+ RootBlock(HtmlWriter *writer);
virtual ~RootBlock();
protected:
diff --git a/messageviewer/src/messagepartthemes/default/messagepartrendererbase.h b/messageviewer/src/messagepartthemes/default/messagepartrendererbase.h
index 809db87..7fd5cfa 100644
--- a/messageviewer/src/messagepartthemes/default/messagepartrendererbase.h
+++ b/messageviewer/src/messagepartthemes/default/messagepartrendererbase.h
@@ -39,12 +39,9 @@
#include <QSharedPointer>
-namespace MimeTreeParser {
-class HtmlWriter;
-}
-
namespace MessageViewer {
class CSSHelperBase;
+class HtmlWriter;
class MESSAGEVIEWER_EXPORT RenderContext
{
@@ -53,23 +50,23 @@ public:
virtual CSSHelperBase *cssHelper() const = 0;
template<typename T>
- inline bool renderWithFactory(const MimeTreeParser::MessagePart::Ptr &msgPart, MimeTreeParser::HtmlWriter *writer)
+ inline bool renderWithFactory(const MimeTreeParser::MessagePart::Ptr &msgPart, HtmlWriter *writer)
{
return renderWithFactory(&T::staticMetaObject, msgPart, writer);
}
- inline bool renderWithFactory(const MimeTreeParser::MessagePart::Ptr &msgPart, MimeTreeParser::HtmlWriter *writer)
+ inline bool renderWithFactory(const MimeTreeParser::MessagePart::Ptr &msgPart, HtmlWriter *writer)
{
return renderWithFactory(msgPart->metaObject(), msgPart, writer);
}
- virtual void renderSubParts(const MimeTreeParser::MessagePart::Ptr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter) = 0;
+ virtual void renderSubParts(const MimeTreeParser::MessagePart::Ptr &msgPart, HtmlWriter *htmlWriter) = 0;
virtual bool isHiddenHint(const MimeTreeParser::MessagePart::Ptr &msgPart) = 0;
virtual MimeTreeParser::IconType displayHint(const MimeTreeParser::MessagePart::Ptr &msgPart) = 0;
protected:
- virtual bool renderWithFactory(const QMetaObject *mo, const MimeTreeParser::MessagePart::Ptr &msgPart, MimeTreeParser::HtmlWriter *writer) = 0;
+ virtual bool renderWithFactory(const QMetaObject *mo, const MimeTreeParser::MessagePart::Ptr &msgPart, HtmlWriter *writer) = 0;
};
class MESSAGEVIEWER_EXPORT MessagePartRendererBase
@@ -77,7 +74,7 @@ class MESSAGEVIEWER_EXPORT MessagePartRendererBase
public:
MessagePartRendererBase();
virtual ~MessagePartRendererBase();
- virtual bool render(const MimeTreeParser::MessagePart::Ptr &, MimeTreeParser::HtmlWriter *htmlWriter, RenderContext *context)
+ virtual bool render(const MimeTreeParser::MessagePart::Ptr &, HtmlWriter *htmlWriter, RenderContext *context)
const = 0;
};
}
diff --git a/messageviewer/src/messagepartthemes/default/plugins/attachmentmessagepartrenderer.cpp b/messageviewer/src/messagepartthemes/default/plugins/attachmentmessagepartrenderer.cpp
index d3607b3..0ce36b7 100644
--- a/messageviewer/src/messagepartthemes/default/plugins/attachmentmessagepartrenderer.cpp
+++ b/messageviewer/src/messagepartthemes/default/plugins/attachmentmessagepartrenderer.cpp
@@ -26,7 +26,7 @@
#include "../messagepartrenderermanager.h"
#include <MessageCore/StringUtil>
-#include <MimeTreeParser/HtmlWriter>
+#include "interfaces/htmlwriter.h"
#include <KIconLoader>
#include <KLocalizedString>
@@ -42,7 +42,7 @@ AttachmentMessagePartRenderer::~AttachmentMessagePartRenderer()
{
}
-bool AttachmentMessagePartRenderer::render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, RenderContext *context) const
+bool AttachmentMessagePartRenderer::render(const MimeTreeParser::MessagePartPtr &msgPart, HtmlWriter *htmlWriter, RenderContext *context) const
{
auto mp = msgPart.dynamicCast<AttachmentMessagePart>();
if (!mp) {
diff --git a/messageviewer/src/messagepartthemes/default/plugins/attachmentmessagepartrenderer.h b/messageviewer/src/messagepartthemes/default/plugins/attachmentmessagepartrenderer.h
index 44def8f..e4829a7 100644
--- a/messageviewer/src/messagepartthemes/default/plugins/attachmentmessagepartrenderer.h
+++ b/messageviewer/src/messagepartthemes/default/plugins/attachmentmessagepartrenderer.h
@@ -28,7 +28,7 @@ class AttachmentMessagePartRenderer : public MessagePartRendererBase
public:
AttachmentMessagePartRenderer();
virtual ~AttachmentMessagePartRenderer();
- bool render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, RenderContext *context) const override;
+ bool render(const MimeTreeParser::MessagePartPtr &msgPart, HtmlWriter *htmlWriter, RenderContext *context) const override;
};
}
diff --git a/messageviewer/src/messagepartthemes/default/plugins/messagepartrenderer.cpp b/messageviewer/src/messagepartthemes/default/plugins/messagepartrenderer.cpp
index 73ce4ee..00732af 100644
--- a/messageviewer/src/messagepartthemes/default/plugins/messagepartrenderer.cpp
+++ b/messageviewer/src/messagepartthemes/default/plugins/messagepartrenderer.cpp
@@ -24,7 +24,7 @@
#include "../htmlblock.h"
#include "../defaultrenderer_p.h"
-#include <MimeTreeParser/HtmlWriter>
+#include "interfaces/htmlwriter.h"
using namespace MessageViewer;
@@ -36,9 +36,9 @@ MessagePartRenderer::~MessagePartRenderer()
{
}
-bool MessagePartRenderer::render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, RenderContext *context) const
+bool MessagePartRenderer::render(const MimeTreeParser::MessagePartPtr &msgPart, HtmlWriter *htmlWriter, RenderContext *context) const
{
- MimeTreeParser::AttachmentMarkBlock block(nullptr, msgPart->attachmentContent());
+ AttachmentMarkBlock block(nullptr, msgPart->attachmentContent());
if (msgPart->isAttachment()) {
htmlWriter->write(block.enter());
}
diff --git a/messageviewer/src/messagepartthemes/default/plugins/messagepartrenderer.h b/messageviewer/src/messagepartthemes/default/plugins/messagepartrenderer.h
index c1e79f0..98651b5 100644
--- a/messageviewer/src/messagepartthemes/default/plugins/messagepartrenderer.h
+++ b/messageviewer/src/messagepartthemes/default/plugins/messagepartrenderer.h
@@ -30,7 +30,7 @@ class MessagePartRenderer : public MessagePartRendererBase
public:
MessagePartRenderer();
virtual ~MessagePartRenderer();
- bool render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, RenderContext *context) const override;
+ bool render(const MimeTreeParser::MessagePartPtr &msgPart, HtmlWriter *htmlWriter, RenderContext *context) const override;
};
}
diff --git a/messageviewer/src/messagepartthemes/default/plugins/textmessagepartrenderer.cpp b/messageviewer/src/messagepartthemes/default/plugins/textmessagepartrenderer.cpp
index 09d28bb..f3f765d 100644
--- a/messageviewer/src/messagepartthemes/default/plugins/textmessagepartrenderer.cpp
+++ b/messageviewer/src/messagepartthemes/default/plugins/textmessagepartrenderer.cpp
@@ -25,7 +25,7 @@
#include "../messagepartrenderermanager.h"
#include <MessageCore/StringUtil>
-#include <MimeTreeParser/HtmlWriter>
+#include "interfaces/htmlwriter.h"
#include <grantlee/context.h>
#include <grantlee/template.h>
@@ -40,7 +40,7 @@ TextMessagePartRenderer::~TextMessagePartRenderer()
{
}
-bool TextMessagePartRenderer::render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, RenderContext *context) const
+bool TextMessagePartRenderer::render(const MimeTreeParser::MessagePartPtr &msgPart, HtmlWriter *htmlWriter, RenderContext *context) const
{
Q_UNUSED(context);
auto mp = msgPart.dynamicCast<TextMessagePart>();
diff --git a/messageviewer/src/messagepartthemes/default/plugins/textmessagepartrenderer.h b/messageviewer/src/messagepartthemes/default/plugins/textmessagepartrenderer.h
index 4fe7353..8c7ef6e 100644
--- a/messageviewer/src/messagepartthemes/default/plugins/textmessagepartrenderer.h
+++ b/messageviewer/src/messagepartthemes/default/plugins/textmessagepartrenderer.h
@@ -28,7 +28,7 @@ class TextMessagePartRenderer : public MessagePartRendererBase
public:
TextMessagePartRenderer();
virtual ~TextMessagePartRenderer();
- bool render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, RenderContext *context) const override;
+ bool render(const MimeTreeParser::MessagePartPtr &msgPart, HtmlWriter *htmlWriter, RenderContext *context) const override;
};
}
diff --git a/messageviewer/src/viewer/objecttreeemptysource.cpp b/messageviewer/src/viewer/objecttreeemptysource.cpp
index 73af51e..2c75a1c 100644
--- a/messageviewer/src/viewer/objecttreeemptysource.cpp
+++ b/messageviewer/src/viewer/objecttreeemptysource.cpp
@@ -27,6 +27,8 @@
#include "messagepartthemes/default/defaultrenderer.h"
+#include "messageviewer_debug.h"
+
using namespace MessageViewer;
namespace MessageViewer {
@@ -105,7 +107,7 @@ const AttachmentStrategy *EmptySource::attachmentStrategy()
return AttachmentStrategy::smart();
}
-MimeTreeParser::HtmlWriter *EmptySource::htmlWriter()
+HtmlWriter *EmptySource::htmlWriter()
{
return nullptr;
}
@@ -140,10 +142,14 @@ bool EmptySource::isPrinting() const
return false;
}
-void EmptySource::render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, bool showOnlyOneMimePart)
+void EmptySource::render(const MimeTreeParser::MessagePartPtr &msgPart, bool showOnlyOneMimePart)
{
+ if (!htmlWriter()) {
+ qCWarning(MESSAGEVIEWER_LOG) << "no htmlWriter - skipping rendering.";
+ return;
+ }
auto renderer = DefaultRenderer(cssHelper());
renderer.setShowOnlyOneMimePart(showOnlyOneMimePart);
renderer.setAttachmentStrategy(attachmentStrategy());
- renderer.render(msgPart, htmlWriter);
+ renderer.render(msgPart, htmlWriter());
}
diff --git a/messageviewer/src/viewer/objecttreeemptysource.h b/messageviewer/src/viewer/objecttreeemptysource.h
index c2bf071..397edca 100644
--- a/messageviewer/src/viewer/objecttreeemptysource.h
+++ b/messageviewer/src/viewer/objecttreeemptysource.h
@@ -27,6 +27,7 @@ class QString;
namespace MessageViewer {
class AttachmentStrategy;
class CSSHelperBase;
+class HtmlWriter;
/** An ObjectTreeSource that does not work on anything */
class EmptySourcePrivate;
@@ -45,14 +46,14 @@ public:
const QTextCodec *overrideCodec() override;
QString createMessageHeader(KMime::Message *message) override;
virtual const AttachmentStrategy *attachmentStrategy();
- MimeTreeParser::HtmlWriter *htmlWriter() override;
+ virtual HtmlWriter *htmlWriter();
virtual CSSHelperBase *cssHelper();
bool autoImportKeys() const override;
bool showEmoticons() const override;
bool showExpandQuotesMark() const override;
const MimeTreeParser::BodyPartFormatterFactory *bodyPartFormatterFactory() override;
- void render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, bool showOnlyOneMimePart) override;
+ void render(const MimeTreeParser::MessagePartPtr &msgPart, bool showOnlyOneMimePart) override;
bool isPrinting() const override;
private:
EmptySourcePrivate *const d;
diff --git a/messageviewer/src/viewer/objecttreeviewersource.cpp b/messageviewer/src/viewer/objecttreeviewersource.cpp
index acd0029..3cb8aa9 100644
--- a/messageviewer/src/viewer/objecttreeviewersource.cpp
+++ b/messageviewer/src/viewer/objecttreeviewersource.cpp
@@ -99,7 +99,7 @@ const AttachmentStrategy *MailViewerSource::attachmentStrategy()
return mViewer->attachmentStrategy();
}
-MimeTreeParser::HtmlWriter *MailViewerSource::htmlWriter()
+HtmlWriter *MailViewerSource::htmlWriter()
{
return mViewer->htmlWriter();
}
@@ -129,10 +129,10 @@ bool MailViewerSource::isPrinting() const
return mViewer->mPrinting;
}
-void MailViewerSource::render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, bool showOnlyOneMimePart)
+void MailViewerSource::render(const MimeTreeParser::MessagePartPtr &msgPart, bool showOnlyOneMimePart)
{
auto renderer = DefaultRenderer(mViewer->cssHelper());
renderer.setShowOnlyOneMimePart(showOnlyOneMimePart);
renderer.setAttachmentStrategy(attachmentStrategy());
- renderer.render(msgPart, htmlWriter);
+ renderer.render(msgPart, htmlWriter());
}
diff --git a/messageviewer/src/viewer/objecttreeviewersource.h b/messageviewer/src/viewer/objecttreeviewersource.h
index eb95ab3..76307a7 100644
--- a/messageviewer/src/viewer/objecttreeviewersource.h
+++ b/messageviewer/src/viewer/objecttreeviewersource.h
@@ -26,6 +26,7 @@ class QString;
namespace MessageViewer {
class AttachmentStrategy;
+class HtmlWriter;
class ViewerPrivate;
/** An ObjectTreeParser source working on a MailViewer object */
@@ -43,13 +44,13 @@ public:
const QTextCodec *overrideCodec() override;
QString createMessageHeader(KMime::Message *message) override;
const AttachmentStrategy *attachmentStrategy();
- MimeTreeParser::HtmlWriter *htmlWriter() override;
+ virtual HtmlWriter *htmlWriter();
bool autoImportKeys() const override;
bool showEmoticons() const override;
bool showExpandQuotesMark() const override;
const MimeTreeParser::BodyPartFormatterFactory *bodyPartFormatterFactory() override;
- void render(const MimeTreeParser::MessagePartPtr &msgPart, MimeTreeParser::HtmlWriter *htmlWriter, bool showOnlyOneMimePart) override;
+ void render(const MimeTreeParser::MessagePartPtr &msgPart, bool showOnlyOneMimePart) override;
bool isPrinting() const override;
private:
ViewerPrivate *mViewer = nullptr;
diff --git a/messageviewer/src/viewer/viewer_p.cpp b/messageviewer/src/viewer/viewer_p.cpp
index e2e6db2..ffc2cab 100644
--- a/messageviewer/src/viewer/viewer_p.cpp
+++ b/messageviewer/src/viewer/viewer_p.cpp
@@ -123,7 +123,7 @@
#include <WebEngineViewer/LocalDataBaseManager>
#include <MimeTreeParser/BodyPart>
-#include <MimeTreeParser/HtmlWriter>
+#include "interfaces/htmlwriter.h"
#include <MimeTreeParser/NodeHelper>
#include <MimeTreeParser/ObjectTreeParser>
@@ -811,7 +811,7 @@ bool ViewerPrivate::showEmoticons() const
return mForceEmoticons;
}
-MimeTreeParser::HtmlWriter *ViewerPrivate::htmlWriter() const
+HtmlWriter *ViewerPrivate::htmlWriter() const
{
return mHtmlWriter;
}
diff --git a/messageviewer/src/viewer/viewer_p.h b/messageviewer/src/viewer/viewer_p.h
index fdee845..63eb75c 100644
--- a/messageviewer/src/viewer/viewer_p.h
+++ b/messageviewer/src/viewer/viewer_p.h
@@ -66,7 +66,6 @@ class ShareServiceUrlManager;
}
namespace MimeTreeParser {
-class HtmlWriter;
class ObjectTreeParser;
}
@@ -79,6 +78,7 @@ class LocalDataBaseManager;
namespace MessageViewer {
class AttachmentStrategy;
class HeaderStylePlugin;
+class HtmlWriter;
class CSSHelper;
class MailWebEngineView;
class WebEnginePartHtmlWriter;
@@ -119,7 +119,7 @@ update() is just a thin wrapper that calls updateReaderWin(). The only differenc
has a timer that prevents too many slow calls to updateReaderWin() in a short time frame.
updateReaderWin() again is only a thin wrapper that resets some state and then calls
displayMessage().
-displayMessage() itself is again a thin wrapper, which starts the MimeTreeParser::HtmlWriter and then calls
+displayMessage() itself is again a thin wrapper, which starts the HtmlWriter and then calls
parseMsg().
Finally, parseMsg() does the real work. It uses MimeTreeParser::ObjectTreeParser ::parseObjectTree() to let the
MimeTreeParser::ObjectTreeParser parse the message and generate the HTML code for it.
@@ -183,7 +183,7 @@ which is used for the colored frame are both created by the MimeTreeParser::Obje
\par Misc
ViewerPrivate holds the MimeTreeParser::NodeHelper, which is passed on to the MimeTreeParser::ObjectTreeParser when it needs it.
-It also holds the HeaderStyle, HeaderStrategy, MimeTreeParser::AttachmentStrategy, CSSHelper, MimeTreeParser::HtmlWriter and more,
+It also holds the HeaderStyle, HeaderStrategy, MimeTreeParser::AttachmentStrategy, CSSHelper, HtmlWriter and more,
some of them again passed to the MimeTreeParser::ObjectTreeParser when it needs it.
@@ -235,8 +235,8 @@ public:
void attachmentOpenWith(KMime::Content *node, const KService::Ptr &offer = KService::Ptr());
void attachmentOpen(KMime::Content *node);
- /** Return the MimeTreeParser::HtmlWriter connected to the MailWebView we use */
- MimeTreeParser::HtmlWriter *htmlWriter() const;
+ /** Return the HtmlWriter connected to the MailWebView we use */
+ HtmlWriter *htmlWriter() const;
HeaderStylePlugin *headerStylePlugin() const;
@@ -649,7 +649,7 @@ public:
QUrl mImageUrl;
QPoint mLastClickPosition;
bool mCanStartDrag;
- MimeTreeParser::HtmlWriter *mHtmlWriter;
+ HtmlWriter *mHtmlWriter;
/** Used only to be able to connect and disconnect finished() signal
in printMsg() and slotPrintMsg() since mHtmlWriter points only to abstract non-QObject class. */
QPointer<WebEnginePartHtmlWriter> mPartHtmlWriter;
diff --git a/mimetreeparser/autotests/attachmenttest.cpp b/mimetreeparser/autotests/attachmenttest.cpp
index 44e40a4..98e6d18 100644
--- a/mimetreeparser/autotests/attachmenttest.cpp
+++ b/mimetreeparser/autotests/attachmenttest.cpp
@@ -55,7 +55,7 @@ void AttachmentTest::testEncryptedAttachment()
QFETCH(QString, mbox);
auto msg = readAndParseMail(mbox);
NodeHelper nodeHelper;
- Test::TestObjectTreeSource testSource(nullptr);
+ Test::TestObjectTreeSource testSource;
testSource.setAllowDecryption(true);
ObjectTreeParser otp(&testSource, &nodeHelper);
otp.parseObjectTree(msg.data());
diff --git a/mimetreeparser/autotests/setupenv.h b/mimetreeparser/autotests/setupenv.h
index a950f90..6b6988e 100644
--- a/mimetreeparser/autotests/setupenv.h
+++ b/mimetreeparser/autotests/setupenv.h
@@ -41,20 +41,13 @@ void setupEnv();
class TestObjectTreeSource : public MimeTreeParser::Interface::ObjectTreeSource
{
public:
- TestObjectTreeSource(MimeTreeParser::HtmlWriter *writer)
- : mWriter(writer)
- , mAttachmentStrategy(QStringLiteral("smart"))
- , mPreferredMode(Util::Html)
+ TestObjectTreeSource()
+ : mPreferredMode(Util::Html)
, mHtmlLoadExternal(false)
, mDecryptMessage(false)
{
}
- MimeTreeParser::HtmlWriter *htmlWriter() override
- {
- return mWriter;
- }
-
bool htmlLoadExternal() const override
{
return mHtmlLoadExternal;
@@ -137,10 +130,9 @@ public:
return QString(); //do nothing
}
- void render(const MessagePart::Ptr &msgPart, HtmlWriter *htmlWriter, bool showOnlyOneMimePart) override
+ void render(const MessagePart::Ptr &msgPart, bool showOnlyOneMimePart) override
{
Q_UNUSED(msgPart);
- Q_UNUSED(htmlWriter);
Q_UNUSED(showOnlyOneMimePart);
}
@@ -150,8 +142,6 @@ public:
}
private:
- MimeTreeParser::HtmlWriter *mWriter = nullptr;
- QString mAttachmentStrategy;
BodyPartFormatterFactory mBodyPartFormatterFactory;
MimeTreeParser::Util::HtmlMode mPreferredMode;
bool mHtmlLoadExternal = false;
diff --git a/mimetreeparser/src/CMakeLists.txt b/mimetreeparser/src/CMakeLists.txt
index 02b751e..b22b6b6 100644
--- a/mimetreeparser/src/CMakeLists.txt
+++ b/mimetreeparser/src/CMakeLists.txt
@@ -23,7 +23,6 @@ set(libmimetreeparser_main_SRCS
interfaces/bodypartformatter.cpp
interfaces/objecttreesource.cpp
interfaces/bodypart.cpp
- interfaces/htmlwriter.cpp
job/qgpgmejobexecutor.cpp
utils/util.cpp
bodypartformatter.cpp
@@ -39,12 +38,6 @@ set(libmimetreeparser_main_SRCS
memento/verifyopaquebodypartmemento.cpp
)
-set(libmimetreeparser_extra_SRCS
- #HTML Writer
- htmlwriter/bufferedhtmlwriter.cpp
- htmlwriter/filehtmlwriter.cpp
- )
-
set(mimetreeparser_temporaryfile_SRCS
temporaryfile/attachmenttemporaryfilesdirs.cpp
)
@@ -74,22 +67,12 @@ ecm_generate_headers(MimeTreeParser_Camelcaseinterfaces_HEADERS
HEADER_NAMES
BodyPartFormatter
BodyPart
- HtmlWriter
ObjectTreeSource
REQUIRED_HEADERS MimeTreeParser_interfaces_HEADERS
PREFIX MimeTreeParser
RELATIVE interfaces
)
-ecm_generate_headers(MimeTreeParser_Camelcasehtmlwriter_HEADERS
- HEADER_NAMES
- BufferedHtmlWriter
- FileHtmlWriter
- REQUIRED_HEADERS MimeTreeParser_htmlwriter_HEADERS
- PREFIX MimeTreeParser
- RELATIVE htmlwriter
- )
-
ecm_generate_headers(MimeTreeParser_Camelcasetemporaryfile_HEADERS
HEADER_NAMES
AttachmentTemporaryFilesDirs
@@ -99,7 +82,6 @@ ecm_generate_headers(MimeTreeParser_Camelcasetemporaryfile_HEADERS
)
install(FILES
- ${MimeTreeParser_Camelcasehtmlwriter_HEADERS}
${MimeTreeParser_Camelcaseutils_HEADERS}
${MimeTreeParser_Camelcaseinterfaces_HEADERS}
${MimeTreeParser_Camelcasemain_HEADERS}
@@ -109,7 +91,6 @@ install(FILES
)
install(FILES
- ${MimeTreeParser_htmlwriter_HEADERS}
${MimeTreeParser_utils_HEADERS}
${MimeTreeParser_interfaces_HEADERS}
${MimeTreeParser_main_HEADERS}
diff --git a/mimetreeparser/src/bodypartformatter.cpp b/mimetreeparser/src/bodypartformatter.cpp
index 8a01d81..978f216 100644
--- a/mimetreeparser/src/bodypartformatter.cpp
+++ b/mimetreeparser/src/bodypartformatter.cpp
@@ -44,7 +44,6 @@
#include "interfaces/bodypartformatter.h"
#include "interfaces/bodypart.h"
-#include "interfaces/htmlwriter.h"
#include "bodypartformatterfactory.h"
#include "bodypartformatterfactory_p.h"
@@ -112,9 +111,9 @@ public:
QString fileName = mp->temporaryFilePath();
QString href = QUrl::fromLocalFile(fileName).url();
QByteArray cid = node->contentID()->identifier();
- if (part.objectTreeParser()->htmlWriter()) {
- part.objectTreeParser()->htmlWriter()->embedPart(cid, href);
- }
+ //if (part.objectTreeParser()->htmlWriter()) {
+ // part.objectTreeParser()->htmlWriter()->embedPart(cid, href);
+ //}
part.nodeHelper()->setNodeDisplayedEmbedded(node, true);
part.nodeHelper()->setNodeDisplayedHidden(node, true);
return mp;
diff --git a/mimetreeparser/src/interfaces/objecttreesource.h b/mimetreeparser/src/interfaces/objecttreesource.h
index f0fcfe3..f96ae49 100644
--- a/mimetreeparser/src/interfaces/objecttreesource.h
+++ b/mimetreeparser/src/interfaces/objecttreesource.h
@@ -29,7 +29,6 @@
class QTextCodec;
namespace MimeTreeParser {
-class HtmlWriter;
class BodyPartFormatterFactory;
class MessagePart;
typedef QSharedPointer<MessagePart> MessagePartPtr;
@@ -73,9 +72,6 @@ public:
virtual QString createMessageHeader(KMime::Message *message) = 0;
- /** Return the html write object */
- virtual HtmlWriter *htmlWriter() = 0;
-
/** should keys be imported automatically **/
virtual bool autoImportKeys() const = 0;
@@ -85,7 +81,7 @@ public:
virtual const BodyPartFormatterFactory *bodyPartFormatterFactory() = 0;
- virtual void render(const MessagePartPtr &msgPart, HtmlWriter *htmlWriter, bool showOnlyOneMimePart) = 0;
+ virtual void render(const MessagePartPtr &msgPart, bool showOnlyOneMimePart) = 0;
virtual bool isPrinting() const = 0;
diff --git a/mimetreeparser/src/objecttreeparser.cpp b/mimetreeparser/src/objecttreeparser.cpp
index 3d3f104..32678e8 100644
--- a/mimetreeparser/src/objecttreeparser.cpp
+++ b/mimetreeparser/src/objecttreeparser.cpp
@@ -45,7 +45,6 @@
#include "bodyformatter/utils.h"
#include "interfaces/bodypartformatter.h"
-#include "interfaces/htmlwriter.h"
#include "utils/util.h"
#include <KMime/Headers>
@@ -62,7 +61,6 @@ using namespace MimeTreeParser;
ObjectTreeParser::ObjectTreeParser(const ObjectTreeParser *topLevelParser)
: mSource(topLevelParser->mSource)
, mNodeHelper(topLevelParser->mNodeHelper)
- , mHtmlWriter(topLevelParser->mHtmlWriter)
, mTopLevelContent(topLevelParser->mTopLevelContent)
, mHasPendingAsyncJobs(false)
, mAllowAsync(topLevelParser->mAllowAsync)
@@ -73,7 +71,6 @@ ObjectTreeParser::ObjectTreeParser(const ObjectTreeParser *topLevelParser)
ObjectTreeParser::ObjectTreeParser(Interface::ObjectTreeSource *source, MimeTreeParser::NodeHelper *nodeHelper)
: mSource(source)
, mNodeHelper(nodeHelper)
- , mHtmlWriter(nullptr)
, mTopLevelContent(nullptr)
, mHasPendingAsyncJobs(false)
, mAllowAsync(false)
@@ -96,8 +93,6 @@ void ObjectTreeParser::init()
ObjectTreeParser::ObjectTreeParser(const ObjectTreeParser &other)
: mSource(other.mSource)
, mNodeHelper(other.nodeHelper())
- , //TODO(Andras) hm, review what happens if mDeleteNodeHelper was true in the source
- mHtmlWriter(other.mHtmlWriter)
, mTopLevelContent(other.mTopLevelContent)
, mHasPendingAsyncJobs(other.hasPendingAsyncJobs())
, mAllowAsync(other.allowAsync())
@@ -171,9 +166,7 @@ void ObjectTreeParser::parseObjectTree(KMime::Content *node, bool parseOnlySingl
setPlainTextContent(mp->text());
}
- if (htmlWriter()) {
- mSource->render(mParsedPart, htmlWriter(), parseOnlySingleNode);
- }
+ mSource->render(mParsedPart, parseOnlySingleNode);
}
}
@@ -342,14 +335,6 @@ QByteArray ObjectTreeParser::htmlContentCharset() const
return mHtmlContentCharset;
}
-HtmlWriter *ObjectTreeParser::htmlWriter() const
-{
- if (mHtmlWriter) {
- return mHtmlWriter;
- }
- return mSource->htmlWriter();
-}
-
MimeTreeParser::NodeHelper *ObjectTreeParser::nodeHelper() const
{
return mNodeHelper;
diff --git a/mimetreeparser/src/objecttreeparser.h b/mimetreeparser/src/objecttreeparser.h
index 1d5a8b1..5fcfcbb 100644
--- a/mimetreeparser/src/objecttreeparser.h
+++ b/mimetreeparser/src/objecttreeparser.h
@@ -50,7 +50,6 @@ class Content;
namespace MimeTreeParser {
class PartMetaData;
class ViewerPrivate;
-class HtmlWriter;
class NodeHelper;
class MessagePart;
class MimeMessagePart;
@@ -246,7 +245,7 @@ yet happened at the time of writing. Therefore the code can seem a bit chaotic.
External plugins are loaded with loadPlugins() in bodypartformatterfactory.cpp. External plugins
can only use the classes in the interfaces/ directory, they include BodyPart, BodyPartMemento,
-BodyPartFormatterPlugin, BodyPartFormatter, BodyPartURLHandler, HtmlWriter and URLHandler. Therefore
+BodyPartFormatterPlugin, BodyPartFormatter, BodyPartURLHandler and URLHandler. Therefore
external plugins have powerful capabilities, which are needed for example in the iCal formatter or
in the vCard formatter.
@@ -303,8 +302,6 @@ public:
QByteArray plainTextContentCharset() const;
QByteArray htmlContentCharset() const;
- HtmlWriter *htmlWriter() const;
-
NodeHelper *nodeHelper() const;
/** Parse beginning at a given node and recursively parsing
@@ -335,7 +332,6 @@ private:
private:
Interface::ObjectTreeSource *mSource;
NodeHelper *mNodeHelper;
- HtmlWriter *mHtmlWriter;
QByteArray mPlainTextContentCharset;
QByteArray mHtmlContentCharset;
QString mPlainTextContent;