Commit 96daff37 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Start using MessageViewer::MessageViewerRenderer

parent 43d7bec6
......@@ -24,6 +24,7 @@
#include "messageviewer_debug.h"
#include "utils/mimetype.h"
#include "viewer/renderer/messageviewerrenderer.h"
#include "viewer/objecttreeemptysource.h"
#include "viewer/objecttreeviewersource.h"
#include "messagedisplayformatattribute.h"
......@@ -190,6 +191,8 @@ ViewerPrivate::ViewerPrivate(Viewer *aParent, QWidget *mainWindow, KActionCollec
if (!mainWindow) {
mMainWindow = aParent;
}
mMessageViewerRenderer = new MessageViewerRenderer;
#ifdef USE_DKIM_CHECKER
mDkimWidgetInfo = new MessageViewer::DKIMWidgetInfo(mMainWindow);
#endif
......@@ -258,7 +261,6 @@ ViewerPrivate::~ViewerPrivate()
mHtmlWriter = nullptr;
delete mViewer;
mViewer = nullptr;
delete mCSSHelper;
mNodeHelper->forceCleanTempFiles();
qDeleteAll(mListMailSourceViewer);
delete mNodeHelper;
......@@ -739,7 +741,7 @@ HtmlWriter *ViewerPrivate::htmlWriter() const
CSSHelper *ViewerPrivate::cssHelper() const
{
return mCSSHelper;
return mMessageViewerRenderer->cssHelper();
}
MimeTreeParser::NodeHelper *ViewerPrivate::nodeHelper() const
......@@ -1034,6 +1036,7 @@ void ViewerPrivate::slotWheelZoomChanged(int numSteps)
void ViewerPrivate::readConfig()
{
mMessageViewerRenderer->setCurrentWidget(mViewer);
recreateCssHelper();
mForceEmoticons = MessageViewer::MessageViewerSettings::self()->showEmoticons();
......@@ -1081,8 +1084,7 @@ void ViewerPrivate::readConfig()
void ViewerPrivate::recreateCssHelper()
{
delete mCSSHelper;
mCSSHelper = new CSSHelper(mViewer);
mMessageViewerRenderer->recreateCssHelper();
}
void ViewerPrivate::hasMultiMessages(bool messages)
......
......@@ -87,6 +87,7 @@ class AttachmentStrategy;
class HeaderStylePlugin;
class HtmlWriter;
class CSSHelper;
class MessageViewerRenderer;
class MailWebEngineView;
class WebEnginePartHtmlWriter;
class HtmlStatusBar;
......@@ -626,7 +627,6 @@ public:
/// the splash/busy page is displayed.
bool mMsgDisplay = true;
CSSHelper *mCSSHelper = nullptr;
bool mUseFixedFont = false;
bool mPrinting = false;
QWidget *mMainWindow = nullptr;
......@@ -699,6 +699,7 @@ public:
#ifdef USE_DKIM_CHECKER
MessageViewer::DKIMWidgetInfo *mDkimWidgetInfo = nullptr;
#endif
MessageViewer::MessageViewerRenderer *mMessageViewerRenderer = nullptr;
};
}
......
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