diff options
author | Christian Mollekopf <mollekopf@kolabsystems.com> | 2017-10-09 17:43:23 +0200 |
---|---|---|
committer | Christian Mollekopf <mollekopf@kolabsystems.com> | 2017-10-09 17:43:23 +0200 |
commit | c01bd56f6fd78a33669e683f088db36d6c920f39 (patch) | |
tree | dd93de0fed0e3fa688c53ad09cdafb6a6951ff36 | |
parent | e7792901613067651ec330c49204ddde2dbe34b3 (diff) | |
download | kube-c01bd56f6fd78a33669e683f088db36d6c920f39.tar.gz kube-c01bd56f6fd78a33669e683f088db36d6c920f39.zip |
Don't use QWebEnginePage to convert to plaintext
Turns out it doesn't return consistent results.
(mailtemplatetest testHtmlReply() sometimes comes back with "HTML text"
and sometimes with "HTML text", depending on the host).
Let's see into what limitations we run with QTextDocument instead.
-rw-r--r-- | framework/src/domain/mime/mailtemplates.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/framework/src/domain/mime/mailtemplates.cpp b/framework/src/domain/mime/mailtemplates.cpp index 368d0cf3..e8d80d40 100644 --- a/framework/src/domain/mime/mailtemplates.cpp +++ b/framework/src/domain/mime/mailtemplates.cpp | |||
@@ -404,15 +404,7 @@ void plainMessageText(const QString &plainTextContent, const QString &htmlConten | |||
404 | { | 404 | { |
405 | QString result = plainTextContent; | 405 | QString result = plainTextContent; |
406 | if (plainTextContent.isEmpty()) { //HTML-only mails | 406 | if (plainTextContent.isEmpty()) { //HTML-only mails |
407 | auto page = new QWebEnginePage; | 407 | callback(toPlainText(htmlContent)); |
408 | setupPage(page); | ||
409 | page->setHtml(htmlContent); | ||
410 | QObject::connect(page, &QWebEnginePage::loadFinished, [=] (bool ok) { | ||
411 | page->toPlainText([=] (const QString &plaintext) { | ||
412 | page->deleteLater(); | ||
413 | callback(plaintext); | ||
414 | }); | ||
415 | }); | ||
416 | return; | 408 | return; |
417 | } | 409 | } |
418 | 410 | ||