From c01bd56f6fd78a33669e683f088db36d6c920f39 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 9 Oct 2017 17:43:23 +0200 Subject: 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. --- framework/src/domain/mime/mailtemplates.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'framework') 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 { QString result = plainTextContent; if (plainTextContent.isEmpty()) { //HTML-only mails - auto page = new QWebEnginePage; - setupPage(page); - page->setHtml(htmlContent); - QObject::connect(page, &QWebEnginePage::loadFinished, [=] (bool ok) { - page->toPlainText([=] (const QString &plaintext) { - page->deleteLater(); - callback(plaintext); - }); - }); + callback(toPlainText(htmlContent)); return; } -- cgit v1.2.3