diff options
author | Sandro Knauß <sknauss@kde.org> | 2016-03-29 14:04:40 +0200 |
---|---|---|
committer | Sandro Knauß <sknauss@kde.org> | 2016-03-29 14:04:40 +0200 |
commit | 0cb9c3d4632819a681c1a7eae2f985dff92db9f7 (patch) | |
tree | e9ae5177f1051b27c1f8e4d3e70656e5cf3d4e70 | |
parent | 5b253b3a5da0829fa9b8f54f26a7f8f6f450c6e9 (diff) | |
download | kube-0cb9c3d4632819a681c1a7eae2f985dff92db9f7.tar.gz kube-0cb9c3d4632819a681c1a7eae2f985dff92db9f7.zip |
Adapt the move from Otp -> MimeTreeParser
-rw-r--r-- | framework/CMakeLists.txt | 2 | ||||
-rw-r--r-- | framework/domain/CMakeLists.txt | 2 | ||||
-rw-r--r-- | framework/domain/csshelper.cpp | 2 | ||||
-rw-r--r-- | framework/domain/csshelper.h | 4 | ||||
-rw-r--r-- | framework/domain/mailtemplates.cpp | 10 | ||||
-rw-r--r-- | framework/domain/messageparser.cpp | 6 | ||||
-rw-r--r-- | framework/domain/messageparser.h | 4 | ||||
-rw-r--r-- | framework/domain/objecttreesource.cpp | 29 | ||||
-rw-r--r-- | framework/domain/objecttreesource.h | 17 | ||||
-rw-r--r-- | framework/domain/stringhtmlwriter.cpp | 2 | ||||
-rw-r--r-- | framework/domain/stringhtmlwriter.h | 4 |
11 files changed, 45 insertions, 37 deletions
diff --git a/framework/CMakeLists.txt b/framework/CMakeLists.txt index d795e992..c216d3c0 100644 --- a/framework/CMakeLists.txt +++ b/framework/CMakeLists.txt | |||
@@ -16,7 +16,7 @@ include(KDEInstallDirs) | |||
16 | 16 | ||
17 | find_package(Qt5 COMPONENTS REQUIRED Core Qml) | 17 | find_package(Qt5 COMPONENTS REQUIRED Core Qml) |
18 | 18 | ||
19 | find_package(KF5Otp "5.1.42" CONFIG REQUIRED) | 19 | find_package(KF5MimeTreeParser "5.1.46" CONFIG REQUIRED) |
20 | find_package(KF5Mime "4.87.0" CONFIG REQUIRED) | 20 | find_package(KF5Mime "4.87.0" CONFIG REQUIRED) |
21 | find_package(Sink CONFIG REQUIRED) | 21 | find_package(Sink CONFIG REQUIRED) |
22 | find_package(KF5Async CONFIG REQUIRED) | 22 | find_package(KF5Async CONFIG REQUIRED) |
diff --git a/framework/domain/CMakeLists.txt b/framework/domain/CMakeLists.txt index 435db5cf..f40463be 100644 --- a/framework/domain/CMakeLists.txt +++ b/framework/domain/CMakeLists.txt | |||
@@ -26,7 +26,7 @@ include_directories(${CURL_INCLUDE_DIRS}) | |||
26 | add_library(mailplugin SHARED ${mailplugin_SRCS}) | 26 | add_library(mailplugin SHARED ${mailplugin_SRCS}) |
27 | 27 | ||
28 | qt5_use_modules(mailplugin Core Quick Qml WebKitWidgets) | 28 | qt5_use_modules(mailplugin Core Quick Qml WebKitWidgets) |
29 | target_link_libraries(mailplugin actionplugin settingsplugin sink KF5::Otp KF5::Codecs KF5::Package ${CURL_LIBRARIES}) | 29 | target_link_libraries(mailplugin actionplugin settingsplugin sink KF5::MimeTreeParser KF5::Codecs KF5::Package ${CURL_LIBRARIES}) |
30 | 30 | ||
31 | install(TARGETS mailplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/framework/domain) | 31 | install(TARGETS mailplugin DESTINATION ${QML_INSTALL_DIR}/org/kube/framework/domain) |
32 | install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kube/framework/domain) | 32 | install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kube/framework/domain) |
diff --git a/framework/domain/csshelper.cpp b/framework/domain/csshelper.cpp index a6355c57..8b61ddcc 100644 --- a/framework/domain/csshelper.cpp +++ b/framework/domain/csshelper.cpp | |||
@@ -39,7 +39,7 @@ | |||
39 | #include <QPalette> | 39 | #include <QPalette> |
40 | 40 | ||
41 | CSSHelper::CSSHelper(const QPaintDevice *pd) : | 41 | CSSHelper::CSSHelper(const QPaintDevice *pd) : |
42 | MessageViewer::CSSHelperBase(pd) | 42 | MimeTreeParser::CSSHelperBase(pd) |
43 | { | 43 | { |
44 | 44 | ||
45 | } | 45 | } |
diff --git a/framework/domain/csshelper.h b/framework/domain/csshelper.h index 775014e3..7be0faa5 100644 --- a/framework/domain/csshelper.h +++ b/framework/domain/csshelper.h | |||
@@ -31,9 +31,9 @@ | |||
31 | 31 | ||
32 | #pragma once | 32 | #pragma once |
33 | 33 | ||
34 | #include <MessageViewer/CSSHelperBase> | 34 | #include <MimeTreeParser/CSSHelperBase> |
35 | 35 | ||
36 | class CSSHelper : public MessageViewer::CSSHelperBase | 36 | class CSSHelper : public MimeTreeParser::CSSHelperBase |
37 | { | 37 | { |
38 | public: | 38 | public: |
39 | explicit CSSHelper(const QPaintDevice *pd); | 39 | explicit CSSHelper(const QPaintDevice *pd); |
diff --git a/framework/domain/mailtemplates.cpp b/framework/domain/mailtemplates.cpp index e5ee8533..9b0dab5d 100644 --- a/framework/domain/mailtemplates.cpp +++ b/framework/domain/mailtemplates.cpp | |||
@@ -37,7 +37,7 @@ | |||
37 | #include "objecttreesource.h" | 37 | #include "objecttreesource.h" |
38 | #include "csshelper.h" | 38 | #include "csshelper.h" |
39 | 39 | ||
40 | #include <MessageViewer/ObjectTreeParser> | 40 | #include <MimeTreeParser/ObjectTreeParser> |
41 | 41 | ||
42 | namespace KMime { | 42 | namespace KMime { |
43 | namespace Types { | 43 | namespace Types { |
@@ -341,7 +341,7 @@ QString stripSignature(const QString &msg) | |||
341 | return res; | 341 | return res; |
342 | } | 342 | } |
343 | 343 | ||
344 | QString plainMessageText(MessageViewer::ObjectTreeParser &otp, bool aStripSignature) | 344 | QString plainMessageText(MimeTreeParser::ObjectTreeParser &otp, bool aStripSignature) |
345 | { | 345 | { |
346 | QString result = otp.plainTextContent(); | 346 | QString result = otp.plainTextContent(); |
347 | if (result.isEmpty()) { //HTML-only mails | 347 | if (result.isEmpty()) { //HTML-only mails |
@@ -357,7 +357,7 @@ QString plainMessageText(MessageViewer::ObjectTreeParser &otp, bool aStripSignat | |||
357 | return result; | 357 | return result; |
358 | } | 358 | } |
359 | 359 | ||
360 | QString htmlMessageText(MessageViewer::ObjectTreeParser &otp, bool aStripSignature, QString &headElement) | 360 | QString htmlMessageText(MimeTreeParser::ObjectTreeParser &otp, bool aStripSignature, QString &headElement) |
361 | { | 361 | { |
362 | QString htmlElement = otp.htmlContent(); | 362 | QString htmlElement = otp.htmlContent(); |
363 | 363 | ||
@@ -759,9 +759,9 @@ KMime::Message::Ptr MailTemplates::reply(const KMime::Message::Ptr &origMsg) | |||
759 | StringHtmlWriter htmlWriter; | 759 | StringHtmlWriter htmlWriter; |
760 | QImage paintDevice; | 760 | QImage paintDevice; |
761 | CSSHelper cssHelper(&paintDevice); | 761 | CSSHelper cssHelper(&paintDevice); |
762 | MessageViewer::NodeHelper nodeHelper; | 762 | MimeTreeParser::NodeHelper nodeHelper; |
763 | ObjectTreeSource source(&htmlWriter, &cssHelper); | 763 | ObjectTreeSource source(&htmlWriter, &cssHelper); |
764 | MessageViewer::ObjectTreeParser otp(&source, &nodeHelper); | 764 | MimeTreeParser::ObjectTreeParser otp(&source, &nodeHelper); |
765 | otp.setAllowAsync(false); | 765 | otp.setAllowAsync(false); |
766 | otp.parseObjectTree(origMsg.data()); | 766 | otp.parseObjectTree(origMsg.data()); |
767 | 767 | ||
diff --git a/framework/domain/messageparser.cpp b/framework/domain/messageparser.cpp index 89f67f38..956bfb65 100644 --- a/framework/domain/messageparser.cpp +++ b/framework/domain/messageparser.cpp | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <QImage> | 26 | #include <QImage> |
27 | #include <QDebug> | 27 | #include <QDebug> |
28 | #include <QTime> | 28 | #include <QTime> |
29 | #include <MessageViewer/ObjectTreeParser> | 29 | #include <MimeTreeParser/ObjectTreeParser> |
30 | 30 | ||
31 | MessageParser::MessageParser(QObject *parent) | 31 | MessageParser::MessageParser(QObject *parent) |
32 | : QObject(parent) | 32 | : QObject(parent) |
@@ -59,9 +59,9 @@ void MessageParser::setMessage(const QVariant &message) | |||
59 | QImage paintDevice; | 59 | QImage paintDevice; |
60 | CSSHelper cssHelper(&paintDevice); | 60 | CSSHelper cssHelper(&paintDevice); |
61 | //temporary files only have the lifetime of the nodehelper, so we keep it around until the mail changes. | 61 | //temporary files only have the lifetime of the nodehelper, so we keep it around until the mail changes. |
62 | mNodeHelper = std::make_shared<MessageViewer::NodeHelper>(); | 62 | mNodeHelper = std::make_shared<MimeTreeParser::NodeHelper>(); |
63 | ObjectTreeSource source(&htmlWriter, &cssHelper); | 63 | ObjectTreeSource source(&htmlWriter, &cssHelper); |
64 | MessageViewer::ObjectTreeParser otp(&source, mNodeHelper.get()); | 64 | MimeTreeParser::ObjectTreeParser otp(&source, mNodeHelper.get()); |
65 | 65 | ||
66 | htmlWriter.begin(QString()); | 66 | htmlWriter.begin(QString()); |
67 | htmlWriter.queue(cssHelper.htmlHead(false)); | 67 | htmlWriter.queue(cssHelper.htmlHead(false)); |
diff --git a/framework/domain/messageparser.h b/framework/domain/messageparser.h index ba08a5ec..72b55a5a 100644 --- a/framework/domain/messageparser.h +++ b/framework/domain/messageparser.h | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <QStringList> | 24 | #include <QStringList> |
25 | #include <memory> | 25 | #include <memory> |
26 | 26 | ||
27 | namespace MessageViewer { | 27 | namespace MimeTreeParser { |
28 | class NodeHelper; | 28 | class NodeHelper; |
29 | }; | 29 | }; |
30 | 30 | ||
@@ -47,5 +47,5 @@ signals: | |||
47 | 47 | ||
48 | private: | 48 | private: |
49 | QString mHtml; | 49 | QString mHtml; |
50 | std::shared_ptr<MessageViewer::NodeHelper> mNodeHelper; | 50 | std::shared_ptr<MimeTreeParser::NodeHelper> mNodeHelper; |
51 | }; | 51 | }; |
diff --git a/framework/domain/objecttreesource.cpp b/framework/domain/objecttreesource.cpp index d14b7b9b..e5e3b9cc 100644 --- a/framework/domain/objecttreesource.cpp +++ b/framework/domain/objecttreesource.cpp | |||
@@ -19,7 +19,8 @@ | |||
19 | 19 | ||
20 | #include "objecttreesource.h" | 20 | #include "objecttreesource.h" |
21 | 21 | ||
22 | #include <MessageViewer/AttachmentStrategy> | 22 | #include <MimeTreeParser/AttachmentStrategy> |
23 | #include <MimeTreeParser/BodyPartFormatterBaseFactory> | ||
23 | 24 | ||
24 | class ObjectSourcePrivate | 25 | class ObjectSourcePrivate |
25 | { | 26 | { |
@@ -33,16 +34,17 @@ public: | |||
33 | { | 34 | { |
34 | 35 | ||
35 | } | 36 | } |
36 | MessageViewer::HtmlWriter *mWriter; | 37 | MimeTreeParser::HtmlWriter *mWriter; |
37 | MessageViewer::CSSHelperBase *mCSSHelper; | 38 | MimeTreeParser::CSSHelperBase *mCSSHelper; |
39 | MimeTreeParser::BodyPartFormatterBaseFactory mBodyPartFormatterBaseFactory; | ||
38 | bool mAllowDecryption; | 40 | bool mAllowDecryption; |
39 | bool mHtmlLoadExternal; | 41 | bool mHtmlLoadExternal; |
40 | bool mHtmlMail; | 42 | bool mHtmlMail; |
41 | }; | 43 | }; |
42 | 44 | ||
43 | ObjectTreeSource::ObjectTreeSource(MessageViewer::HtmlWriter *writer, | 45 | ObjectTreeSource::ObjectTreeSource(MimeTreeParser::HtmlWriter *writer, |
44 | MessageViewer::CSSHelperBase *cssHelper) | 46 | MimeTreeParser::CSSHelperBase *cssHelper) |
45 | : MessageViewer::ObjectTreeSourceIf() | 47 | : MimeTreeParser::ObjectTreeSourceIf() |
46 | , d(new ObjectSourcePrivate) | 48 | , d(new ObjectSourcePrivate) |
47 | { | 49 | { |
48 | d->mWriter = writer; | 50 | d->mWriter = writer; |
@@ -59,11 +61,11 @@ void ObjectTreeSource::setAllowDecryption(bool allowDecryption) | |||
59 | d->mAllowDecryption = allowDecryption; | 61 | d->mAllowDecryption = allowDecryption; |
60 | } | 62 | } |
61 | 63 | ||
62 | MessageViewer::HtmlWriter *ObjectTreeSource::htmlWriter() | 64 | MimeTreeParser::HtmlWriter *ObjectTreeSource::htmlWriter() |
63 | { | 65 | { |
64 | return d->mWriter; | 66 | return d->mWriter; |
65 | } | 67 | } |
66 | MessageViewer::CSSHelperBase *ObjectTreeSource::cssHelper() | 68 | MimeTreeParser::CSSHelperBase *ObjectTreeSource::cssHelper() |
67 | { | 69 | { |
68 | return d->mCSSHelper; | 70 | return d->mCSSHelper; |
69 | } | 71 | } |
@@ -113,9 +115,9 @@ QString ObjectTreeSource::createMessageHeader(KMime::Message *message) | |||
113 | return QString(); | 115 | return QString(); |
114 | } | 116 | } |
115 | 117 | ||
116 | const MessageViewer::AttachmentStrategy *ObjectTreeSource::attachmentStrategy() | 118 | const MimeTreeParser::AttachmentStrategy *ObjectTreeSource::attachmentStrategy() |
117 | { | 119 | { |
118 | return MessageViewer::AttachmentStrategy::smart(); | 120 | return MimeTreeParser::AttachmentStrategy::smart(); |
119 | } | 121 | } |
120 | 122 | ||
121 | QObject *ObjectTreeSource::sourceObject() | 123 | QObject *ObjectTreeSource::sourceObject() |
@@ -123,7 +125,7 @@ QObject *ObjectTreeSource::sourceObject() | |||
123 | return Q_NULLPTR; | 125 | return Q_NULLPTR; |
124 | } | 126 | } |
125 | 127 | ||
126 | void ObjectTreeSource::setHtmlMode(MessageViewer::Util::HtmlMode mode) | 128 | void ObjectTreeSource::setHtmlMode(MimeTreeParser::Util::HtmlMode mode) |
127 | { | 129 | { |
128 | Q_UNUSED(mode); | 130 | Q_UNUSED(mode); |
129 | } | 131 | } |
@@ -142,3 +144,8 @@ bool ObjectTreeSource::showExpandQuotesMark() const | |||
142 | { | 144 | { |
143 | return false; | 145 | return false; |
144 | } | 146 | } |
147 | |||
148 | const MimeTreeParser::BodyPartFormatterBaseFactory *ObjectTreeSource::bodyPartFormatterFactory() | ||
149 | { | ||
150 | return &(d->mBodyPartFormatterBaseFactory); | ||
151 | } | ||
diff --git a/framework/domain/objecttreesource.h b/framework/domain/objecttreesource.h index db14e3ff..bdd9b2ba 100644 --- a/framework/domain/objecttreesource.h +++ b/framework/domain/objecttreesource.h | |||
@@ -20,16 +20,16 @@ | |||
20 | #ifndef MAILVIEWER_OBJECTTREEEMPTYSOURCE_H | 20 | #ifndef MAILVIEWER_OBJECTTREEEMPTYSOURCE_H |
21 | #define MAILVIEWER_OBJECTTREEEMPTYSOURCE_H | 21 | #define MAILVIEWER_OBJECTTREEEMPTYSOURCE_H |
22 | 22 | ||
23 | #include <MessageViewer/ObjectTreeSourceIf> | 23 | #include <MimeTreeParser/ObjectTreeSourceIf> |
24 | 24 | ||
25 | class QString; | 25 | class QString; |
26 | 26 | ||
27 | class ObjectSourcePrivate; | 27 | class ObjectSourcePrivate; |
28 | class ObjectTreeSource : public MessageViewer::ObjectTreeSourceIf | 28 | class ObjectTreeSource : public MimeTreeParser::ObjectTreeSourceIf |
29 | { | 29 | { |
30 | public: | 30 | public: |
31 | ObjectTreeSource(MessageViewer::HtmlWriter *writer, | 31 | ObjectTreeSource(MimeTreeParser::HtmlWriter *writer, |
32 | MessageViewer::CSSHelperBase *cssHelper); | 32 | MimeTreeParser::CSSHelperBase *cssHelper); |
33 | virtual ~ObjectTreeSource(); | 33 | virtual ~ObjectTreeSource(); |
34 | void setHtmlLoadExternal(bool loadExternal); | 34 | void setHtmlLoadExternal(bool loadExternal); |
35 | void setHtmlMail(bool htmlMail); | 35 | void setHtmlMail(bool htmlMail); |
@@ -37,18 +37,19 @@ public: | |||
37 | bool decryptMessage() const Q_DECL_OVERRIDE; | 37 | bool decryptMessage() const Q_DECL_OVERRIDE; |
38 | bool htmlLoadExternal() const Q_DECL_OVERRIDE; | 38 | bool htmlLoadExternal() const Q_DECL_OVERRIDE; |
39 | bool showSignatureDetails() const Q_DECL_OVERRIDE; | 39 | bool showSignatureDetails() const Q_DECL_OVERRIDE; |
40 | void setHtmlMode(MessageViewer::Util::HtmlMode mode) Q_DECL_OVERRIDE; | 40 | void setHtmlMode(MimeTreeParser::Util::HtmlMode mode) Q_DECL_OVERRIDE; |
41 | void setAllowDecryption(bool allowDecryption); | 41 | void setAllowDecryption(bool allowDecryption); |
42 | int levelQuote() const Q_DECL_OVERRIDE; | 42 | int levelQuote() const Q_DECL_OVERRIDE; |
43 | const QTextCodec *overrideCodec() Q_DECL_OVERRIDE; | 43 | const QTextCodec *overrideCodec() Q_DECL_OVERRIDE; |
44 | QString createMessageHeader(KMime::Message *message) Q_DECL_OVERRIDE; | 44 | QString createMessageHeader(KMime::Message *message) Q_DECL_OVERRIDE; |
45 | const MessageViewer::AttachmentStrategy *attachmentStrategy() Q_DECL_OVERRIDE; | 45 | const MimeTreeParser::AttachmentStrategy *attachmentStrategy() Q_DECL_OVERRIDE; |
46 | MessageViewer::HtmlWriter *htmlWriter() Q_DECL_OVERRIDE; | 46 | MimeTreeParser::HtmlWriter *htmlWriter() Q_DECL_OVERRIDE; |
47 | MessageViewer::CSSHelperBase *cssHelper() Q_DECL_OVERRIDE; | 47 | MimeTreeParser::CSSHelperBase *cssHelper() Q_DECL_OVERRIDE; |
48 | QObject *sourceObject() Q_DECL_OVERRIDE; | 48 | QObject *sourceObject() Q_DECL_OVERRIDE; |
49 | bool autoImportKeys() const Q_DECL_OVERRIDE; | 49 | bool autoImportKeys() const Q_DECL_OVERRIDE; |
50 | bool showEmoticons() const Q_DECL_OVERRIDE; | 50 | bool showEmoticons() const Q_DECL_OVERRIDE; |
51 | bool showExpandQuotesMark() const Q_DECL_OVERRIDE; | 51 | bool showExpandQuotesMark() const Q_DECL_OVERRIDE; |
52 | const MimeTreeParser::BodyPartFormatterBaseFactory *bodyPartFormatterFactory() Q_DECL_OVERRIDE; | ||
52 | private: | 53 | private: |
53 | ObjectSourcePrivate *const d; | 54 | ObjectSourcePrivate *const d; |
54 | }; | 55 | }; |
diff --git a/framework/domain/stringhtmlwriter.cpp b/framework/domain/stringhtmlwriter.cpp index df108946..b65c992f 100644 --- a/framework/domain/stringhtmlwriter.cpp +++ b/framework/domain/stringhtmlwriter.cpp | |||
@@ -36,7 +36,7 @@ | |||
36 | #include <QUrl> | 36 | #include <QUrl> |
37 | 37 | ||
38 | StringHtmlWriter::StringHtmlWriter() | 38 | StringHtmlWriter::StringHtmlWriter() |
39 | : MessageViewer::HtmlWriter() | 39 | : MimeTreeParser::HtmlWriter() |
40 | , mState(Ended) | 40 | , mState(Ended) |
41 | { | 41 | { |
42 | } | 42 | } |
diff --git a/framework/domain/stringhtmlwriter.h b/framework/domain/stringhtmlwriter.h index fa0a7aa5..c1410d57 100644 --- a/framework/domain/stringhtmlwriter.h +++ b/framework/domain/stringhtmlwriter.h | |||
@@ -30,14 +30,14 @@ | |||
30 | #ifndef __KUBE_FRAMEWORK_MAIL_STRINGHTMLWRITER_H__ | 30 | #ifndef __KUBE_FRAMEWORK_MAIL_STRINGHTMLWRITER_H__ |
31 | #define __KUBE_FRAMEWORK_MAIL_STRINGHTMLWRITER_H__ | 31 | #define __KUBE_FRAMEWORK_MAIL_STRINGHTMLWRITER_H__ |
32 | 32 | ||
33 | #include <MessageViewer/HtmlWriter> | 33 | #include <MimeTreeParser/HtmlWriter> |
34 | 34 | ||
35 | #include <QFile> | 35 | #include <QFile> |
36 | #include <QTextStream> | 36 | #include <QTextStream> |
37 | 37 | ||
38 | class QString; | 38 | class QString; |
39 | 39 | ||
40 | class StringHtmlWriter : public MessageViewer::HtmlWriter | 40 | class StringHtmlWriter : public MimeTreeParser::HtmlWriter |
41 | { | 41 | { |
42 | public: | 42 | public: |
43 | explicit StringHtmlWriter(); | 43 | explicit StringHtmlWriter(); |