From fc7e7f1024e79287b85595ca29f00c708bbe8b24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20Knau=C3=9F?= Date: Tue, 19 Jul 2016 01:38:54 +0200 Subject: update change from mimetreeparser --- framework/domain/CMakeLists.txt | 1 - framework/domain/csshelper.cpp | 64 ----------------------------------- framework/domain/csshelper.h | 44 ------------------------ framework/domain/mailtemplates.cpp | 5 +-- framework/domain/messageparser.cpp | 5 +-- framework/domain/objecttreesource.cpp | 10 +----- framework/domain/objecttreesource.h | 4 +-- 7 files changed, 4 insertions(+), 129 deletions(-) delete mode 100644 framework/domain/csshelper.cpp delete mode 100644 framework/domain/csshelper.h (limited to 'framework') diff --git a/framework/domain/CMakeLists.txt b/framework/domain/CMakeLists.txt index 39a47111..d64aebc5 100644 --- a/framework/domain/CMakeLists.txt +++ b/framework/domain/CMakeLists.txt @@ -5,7 +5,6 @@ set(mailplugin_SRCS actions/sinkactions.cpp objecttreesource.cpp stringhtmlwriter.cpp - csshelper.cpp composercontroller.cpp messageparser.cpp mailtemplates.cpp diff --git a/framework/domain/csshelper.cpp b/framework/domain/csshelper.cpp deleted file mode 100644 index 8b61ddcc..00000000 --- a/framework/domain/csshelper.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - csshelper.cpp - - This file is part of KMail, the KDE mail client. - Copyright (c) 2003 Marc Mutz - - KMail is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - KMail is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - In addition, as a special exception, the copyright holders give - permission to link the code of this program with any edition of - the Qt library by Trolltech AS, Norway (or with modified versions - of Qt that use the same license as Qt), and distribute linked - combinations including the two. You must obey the GNU General - Public License in all respects for all of the code used other than - Qt. If you modify this file, you may extend this exception to - your version of the file, but you are not obligated to do so. If - you do not wish to do so, delete this exception statement from - your version. -*/ - -#include "csshelper.h" - -#include -#include -#include -#include -#include -#include - -CSSHelper::CSSHelper(const QPaintDevice *pd) : - MimeTreeParser::CSSHelperBase(pd) -{ - -} - -QString cssDefinitions() -{ - QFile file(QLatin1String(MAIL_DATA_DIR) + QLatin1Char('/') + "mail.css"); - if (file.open(QFile::ReadOnly)) { - return file.readAll(); - } - return QString(); -} - -QString CSSHelper::htmlHead(bool fixed) const -{ - return - QLatin1String("\n" - "\n" - "\n"); -} \ No newline at end of file diff --git a/framework/domain/csshelper.h b/framework/domain/csshelper.h deleted file mode 100644 index 7be0faa5..00000000 --- a/framework/domain/csshelper.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -*- c++ -*- - csshelper.h - - This file is part of KMail, the KDE mail client. - Copyright (c) 2003 Marc Mutz - - KMail is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License, version 2, as - published by the Free Software Foundation. - - KMail is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - In addition, as a special exception, the copyright holders give - permission to link the code of this program with any edition of - the Qt library by Trolltech AS, Norway (or with modified versions - of Qt that use the same license as Qt), and distribute linked - combinations including the two. You must obey the GNU General - Public License in all respects for all of the code used other than - Qt. If you modify this file, you may extend this exception to - your version of the file, but you are not obligated to do so. If - you do not wish to do so, delete this exception statement from - your version. -*/ - -#pragma once - -#include - -class CSSHelper : public MimeTreeParser::CSSHelperBase -{ -public: - explicit CSSHelper(const QPaintDevice *pd); - - /** @return HTML head including style sheet definitions and the - >body< tag */ - QString htmlHead(bool fixedFont = false) const Q_DECL_OVERRIDE; -}; \ No newline at end of file diff --git a/framework/domain/mailtemplates.cpp b/framework/domain/mailtemplates.cpp index 9b0dab5d..6af381d2 100644 --- a/framework/domain/mailtemplates.cpp +++ b/framework/domain/mailtemplates.cpp @@ -35,7 +35,6 @@ #include "stringhtmlwriter.h" #include "objecttreesource.h" -#include "csshelper.h" #include @@ -757,10 +756,8 @@ KMime::Message::Ptr MailTemplates::reply(const KMime::Message::Ptr &origMsg) //TODO set empty source instead StringHtmlWriter htmlWriter; - QImage paintDevice; - CSSHelper cssHelper(&paintDevice); MimeTreeParser::NodeHelper nodeHelper; - ObjectTreeSource source(&htmlWriter, &cssHelper); + ObjectTreeSource source(&htmlWriter); MimeTreeParser::ObjectTreeParser otp(&source, &nodeHelper); otp.setAllowAsync(false); otp.parseObjectTree(origMsg.data()); diff --git a/framework/domain/messageparser.cpp b/framework/domain/messageparser.cpp index 7be5e052..8363e119 100644 --- a/framework/domain/messageparser.cpp +++ b/framework/domain/messageparser.cpp @@ -20,7 +20,6 @@ #include "stringhtmlwriter.h" #include "objecttreesource.h" -#include "csshelper.h" #include #include @@ -170,11 +169,9 @@ void MessageParser::setMessage(const QVariant &message) // render the mail StringHtmlWriter htmlWriter; - QImage paintDevice; - CSSHelper cssHelper(&paintDevice); //temporary files only have the lifetime of the nodehelper, so we keep it around until the mail changes. mNodeHelper = std::make_shared(); - ObjectTreeSource source(&htmlWriter, &cssHelper); + ObjectTreeSource source(&htmlWriter); MimeTreeParser::ObjectTreeParser otp(&source, mNodeHelper.get()); otp.parseObjectTree(msg.data()); diff --git a/framework/domain/objecttreesource.cpp b/framework/domain/objecttreesource.cpp index 19a216c9..12cf88ab 100644 --- a/framework/domain/objecttreesource.cpp +++ b/framework/domain/objecttreesource.cpp @@ -29,7 +29,6 @@ class ObjectSourcePrivate public: ObjectSourcePrivate() : mWriter(0) - , mCSSHelper(0) , mAllowDecryption(true) , mHtmlLoadExternal(true) , mHtmlMail(true) @@ -37,20 +36,17 @@ public: } MimeTreeParser::HtmlWriter *mWriter; - MimeTreeParser::CSSHelperBase *mCSSHelper; MimeTreeParser::BodyPartFormatterBaseFactory mBodyPartFormatterBaseFactory; bool mAllowDecryption; bool mHtmlLoadExternal; bool mHtmlMail; }; -ObjectTreeSource::ObjectTreeSource(MimeTreeParser::HtmlWriter *writer, - MimeTreeParser::CSSHelperBase *cssHelper) +ObjectTreeSource::ObjectTreeSource(MimeTreeParser::HtmlWriter *writer) : MimeTreeParser::Interface::ObjectTreeSource() , d(new ObjectSourcePrivate) { d->mWriter = writer; - d->mCSSHelper = cssHelper; } ObjectTreeSource::~ObjectTreeSource() @@ -67,10 +63,6 @@ MimeTreeParser::HtmlWriter *ObjectTreeSource::htmlWriter() { return d->mWriter; } -MimeTreeParser::CSSHelperBase *ObjectTreeSource::cssHelper() -{ - return d->mCSSHelper; -} bool ObjectTreeSource::htmlLoadExternal() const { diff --git a/framework/domain/objecttreesource.h b/framework/domain/objecttreesource.h index eceb04d3..bb0cd679 100644 --- a/framework/domain/objecttreesource.h +++ b/framework/domain/objecttreesource.h @@ -28,8 +28,7 @@ class ObjectSourcePrivate; class ObjectTreeSource : public MimeTreeParser::Interface::ObjectTreeSource { public: - ObjectTreeSource(MimeTreeParser::HtmlWriter *writer, - MimeTreeParser::CSSHelperBase *cssHelper); + ObjectTreeSource(MimeTreeParser::HtmlWriter *writer); virtual ~ObjectTreeSource(); void setHtmlLoadExternal(bool loadExternal); void setHtmlMail(bool htmlMail); @@ -44,7 +43,6 @@ public: QString createMessageHeader(KMime::Message *message) Q_DECL_OVERRIDE; const MimeTreeParser::AttachmentStrategy *attachmentStrategy() Q_DECL_OVERRIDE; MimeTreeParser::HtmlWriter *htmlWriter() Q_DECL_OVERRIDE; - MimeTreeParser::CSSHelperBase *cssHelper() Q_DECL_OVERRIDE; QObject *sourceObject() Q_DECL_OVERRIDE; bool autoImportKeys() const Q_DECL_OVERRIDE; bool showEmoticons() const Q_DECL_OVERRIDE; -- cgit v1.2.3