summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-10-26 21:00:26 (GMT)
committerMontel Laurent <montel@kde.org>2016-10-26 21:01:46 (GMT)
commitfece1ec3662732f846e06ce8933a8fbe78f32f3c (patch)
treeb23b231af88ab7f4e5da57c9c22a54901b0e96f3
parent15382290683dfa469e64574b18ee6598d37433bb (diff)
Close viewer source when we close kmail
-rw-r--r--messageviewer/src/viewer/viewer_p.cpp4
-rw-r--r--messageviewer/src/viewer/viewer_p.h3
2 files changed, 6 insertions, 1 deletions
diff --git a/messageviewer/src/viewer/viewer_p.cpp b/messageviewer/src/viewer/viewer_p.cpp
index e87a9da..cf22fb4 100644
--- a/messageviewer/src/viewer/viewer_p.cpp
+++ b/messageviewer/src/viewer/viewer_p.cpp
@@ -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);
diff --git a/messageviewer/src/viewer/viewer_p.h b/messageviewer/src/viewer/viewer_p.h
index 452edd7..5880f77 100644
--- a/messageviewer/src/viewer/viewer_p.h
+++ b/messageviewer/src/viewer/viewer_p.h
@@ -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;
};
}