Commit fece1ec3 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Close viewer source when we close kmail

parent 15382290
......@@ -286,6 +286,7 @@ ViewerPrivate::~ViewerPrivate()
delete mViewer; mViewer = 0;
delete mCSSHelper;
mNodeHelper->forceCleanTempFiles();
qDeleteAll(mListMailSourceViewer);
delete mNodeHelper;
}
......@@ -2120,7 +2121,8 @@ void ViewerPrivate::slotShowMessageSource()
}
mNodeHelper->messageWithExtraContent(mMessage.data());
MailSourceWebEngineViewer *viewer = new MailSourceWebEngineViewer(); // deletes itself upon close
QPointer<MailSourceWebEngineViewer> viewer = new MailSourceWebEngineViewer; // deletes itself upon close
mListMailSourceViewer.append(viewer);
viewer->setWindowTitle(i18n("Message as Plain Text"));
const QString rawMessage = QString::fromLatin1(mMessage->encodedContent());
viewer->setRawSource(rawMessage);
......
......@@ -33,6 +33,7 @@
#include <KMime/Message>
#include <kservice.h>
#include <ksharedconfig.h>
#include <QPointer>
#include <QUrl>
#include <QObject>
......@@ -92,6 +93,7 @@ class HeaderStyleMenuManager;
class ViewerPluginToolManager;
class ViewerPluginInterface;
class SubmittedFormWarningWidget;
class MailSourceWebEngineViewer;
/**
\brief Private class for the Viewer, the main widget in the messageviewer library.
......@@ -682,6 +684,7 @@ public:
MessageViewer::ViewerPluginToolManager *mViewerPluginToolManager;
WebEngineViewer::ZoomActionMenu *mZoomActionMenu;
QPrinter *mCurrentPrinter;
QList<QPointer<MessageViewer::MailSourceWebEngineViewer> > mListMailSourceViewer;
};
}
......
Supports Markdown
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