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

Fix Start to fix HTML content - mangled generation

CCBUG: 421908
parent a5f172bd
Pipeline #20950 passed with stage
in 38 minutes and 40 seconds
......@@ -29,7 +29,7 @@ set(KLDAP_LIB_VERSION "5.14.40")
set(KMAILTRANSPORT_LIB_VERSION "5.14.40")
set(KMBOX_LIB_VERSION "5.14.40")
set(KMIME_LIB_VERSION "5.14.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.14.42")
set(KPIMTEXTEDIT_LIB_VERSION "5.14.45")
set(LIBKDEPIM_LIB_VERSION "5.14.41")
set(LIBKLEO_LIB_VERSION "5.14.40")
set(PIMCOMMON_LIB_VERSION "5.14.40")
......
......@@ -237,7 +237,6 @@ target_link_libraries(KF5MessageComposer
KF5::KIOFileWidgets # for KEncodingDialog
KF5::XmlGui # for KActionCollection
KF5::SonnetUi
Grantlee5::TextDocument
KF5::CalendarCore # for KCalendarCore/Todo
KF5::Archive
KF5::Contacts
......
......@@ -24,10 +24,9 @@
#include <PimCommon/AutoCorrection>
#include <part/textpart.h>
#include "settings/messagecomposersettings.h"
#include <grantlee/markupdirector.h>
#include <grantlee/plaintextmarkupbuilder.h>
#include <KPIMTextEdit/TextHTMLBuilder>
#include <KPIMTextEdit/MarkupDirector>
#include <KPIMTextEdit/PlainTextMarkupBuilder>
using namespace MessageComposer;
......@@ -170,9 +169,9 @@ void RichTextComposerNg::fillComposerTextPart(MessageComposer::TextPart *textPar
if (composerControler()->isFormattingUsed()) {
if (!wasConverted) {
if (MessageComposer::MessageComposerSettings::self()->improvePlainTextOfHtmlMessage()) {
Grantlee::PlainTextMarkupBuilder *pb = new Grantlee::PlainTextMarkupBuilder();
KPIMTextEdit::PlainTextMarkupBuilder *pb = new KPIMTextEdit::PlainTextMarkupBuilder();
Grantlee::MarkupDirector *pmd = new Grantlee::MarkupDirector(pb);
KPIMTextEdit::MarkupDirector *pmd = new KPIMTextEdit::MarkupDirector(pb);
pmd->processDocument(document());
const QString plainText = pb->getResult();
textPart->setCleanPlainText(composerControler()->toCleanPlainText(plainText));
......
......@@ -332,7 +332,6 @@ target_link_libraries(KF5MessageViewer
KF5::KIOFileWidgets
KF5::KIOWidgets
KF5::XmlGui
Grantlee5::TextDocument
Grantlee5::Templates
Qt5::PrintSupport
QGpgme
......
......@@ -37,5 +37,5 @@ ecm_add_test(showonlymimeparttest.cpp setupenv.cpp util.cpp testcsshelper.cpp
ecm_add_test(converthtmltoplaintexttest.cpp ../converthtmltoplaintext.cpp
TEST_NAME converthtmltoplaintexttest
NAME_PREFIX "messageviewer-messageparttheme-"
LINK_LIBRARIES Qt5::Test Grantlee5::TextDocument KF5::PimTextEdit
LINK_LIBRARIES Qt5::Test KF5::PimTextEdit Qt5::Gui
)
......@@ -21,6 +21,7 @@
#include "converthtmltoplaintext.h"
#include <KPIMTextEdit/PlainTextMarkupBuilder>
#include <KPIMTextEdit/MarkupDirector>
#include <QTextDocument>
#include <QDebug>
......@@ -45,7 +46,7 @@ QString ConvertHtmlToPlainText::generatePlainText()
}
KPIMTextEdit::PlainTextMarkupBuilder *pb = new KPIMTextEdit::PlainTextMarkupBuilder();
Grantlee::MarkupDirector *pmd = new Grantlee::MarkupDirector(pb);
KPIMTextEdit::MarkupDirector *pmd = new KPIMTextEdit::MarkupDirector(pb);
QTextDocument *doc = new QTextDocument;
doc->setHtml(mHtmlString);
......
Markdown is supported
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