diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-06-30 16:23:20 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-06-30 16:23:20 +0200 |
commit | ab912af8158028206cf43b0a6ca0eac8eef040f4 (patch) | |
tree | 01010326905cf61a816b74b693b520a719ef22ac /framework/src/domain/mime/mailtemplates.cpp | |
parent | 2945877a9f6062e6a2c5aaf2e6a1fe9c545a6869 (diff) | |
download | kube-ab912af8158028206cf43b0a6ca0eac8eef040f4.tar.gz kube-ab912af8158028206cf43b0a6ca0eac8eef040f4.zip |
Fixed html to plaintext conversion
Diffstat (limited to 'framework/src/domain/mime/mailtemplates.cpp')
-rw-r--r-- | framework/src/domain/mime/mailtemplates.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/framework/src/domain/mime/mailtemplates.cpp b/framework/src/domain/mime/mailtemplates.cpp index d41039db..c202af80 100644 --- a/framework/src/domain/mime/mailtemplates.cpp +++ b/framework/src/domain/mime/mailtemplates.cpp | |||
@@ -396,9 +396,11 @@ void plainMessageText(const QString &plainTextContent, const QString &htmlConten | |||
396 | auto page = new QWebEnginePage; | 396 | auto page = new QWebEnginePage; |
397 | setupPage(page); | 397 | setupPage(page); |
398 | page->setHtml(htmlContent); | 398 | page->setHtml(htmlContent); |
399 | page->toPlainText([=] (const QString &plaintext) { | 399 | QObject::connect(page, &QWebEnginePage::loadFinished, [=] (bool ok) { |
400 | page->deleteLater(); | 400 | page->toPlainText([=] (const QString &plaintext) { |
401 | callback(plaintext); | 401 | page->deleteLater(); |
402 | callback(plaintext); | ||
403 | }); | ||
402 | }); | 404 | }); |
403 | return; | 405 | return; |
404 | } | 406 | } |
@@ -860,7 +862,7 @@ void MailTemplates::reply(const KMime::Message::Ptr &origMsg, const std::functio | |||
860 | makeValidHtml(htmlBodyResult, headElement); | 862 | makeValidHtml(htmlBodyResult, headElement); |
861 | } | 863 | } |
862 | 864 | ||
863 | //Assemble the message */ | 865 | //Assemble the message |
864 | addProcessedBodyToMessage(msg, plainBodyResult, htmlBodyResult, false); | 866 | addProcessedBodyToMessage(msg, plainBodyResult, htmlBodyResult, false); |
865 | applyCharset(msg, origMsg); | 867 | applyCharset(msg, origMsg); |
866 | msg->assemble(); | 868 | msg->assemble(); |