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

Astyle kdelibs

parent 4b271a1d
......@@ -188,10 +188,9 @@ void MessageFactoryTest::testCreateReplyToAllWithUseSender()
"X-KMail-Link-Message: 0\n"
"X-KMail-Link-Type: reply\n\n"
"%3")
.arg(dateStr).arg(userAgent).arg(replyStr);
.arg(dateStr).arg(userAgent).arg(replyStr);
QCOMPARE_OR_DIFF(reply.msg->encodedContent(), ba.toLatin1());
delete identMan;
QDir dir(QDir::homePath() + QStringLiteral("/.qttest/"));
dir.removeRecursively();
......@@ -230,7 +229,7 @@ void MessageFactoryTest::testCreateReplyToList()
"X-KMail-Link-Message: 0\n"
"X-KMail-Link-Type: reply\n\n"
"%3")
.arg(dateStr).arg(userAgent).arg(replyStr);
.arg(dateStr).arg(userAgent).arg(replyStr);
QCOMPARE_OR_DIFF(reply.msg->encodedContent(), ba.toLatin1());
delete identMan;
......@@ -276,7 +275,7 @@ void MessageFactoryTest::testCreateReplyToAuthor()
"X-KMail-Link-Message: 0\n"
"X-KMail-Link-Type: reply\n\n"
"%5")
.arg(dateStr).arg(userAgent).arg(replyTo).arg(reference).arg(replyStr);
.arg(dateStr).arg(userAgent).arg(replyTo).arg(reference).arg(replyStr);
QCOMPARE_OR_DIFF(reply.msg->encodedContent(), ba.toLatin1());
delete identMan;
......@@ -322,7 +321,7 @@ void MessageFactoryTest::testCreateReplyAllWithMultiEmails()
"Content-Transfer-Encoding: 8Bit\nMIME-Version: 1.0\n"
"X-KMail-Link-Message: 0\n"
"X-KMail-Link-Type: reply\n\n> All happy families are alike; each unhappy family is unhappy in its own way.")
.arg(dateStr).arg(userAgent).arg(replyTo).arg(reference);
.arg(dateStr).arg(userAgent).arg(replyTo).arg(reference);
QCOMPARE_OR_DIFF(reply.msg->encodedContent(), ba.toLatin1());
delete identMan;
QDir dir(QDir::homePath() + QStringLiteral("/.qttest/"));
......@@ -379,7 +378,6 @@ void MessageFactoryTest::testCreateReplyHtml()
QCOMPARE(reply.msg->contents().count(), 2);
QCOMPARE_OR_DIFF(reply.msg->contents().at(0)->body(), replyStr.toLatin1());
TemplateParser::TemplateParserSettings::self()->setReplyUsingHtml(false);
reply = factory.createReply();
reply.replyAll = true;
......@@ -401,7 +399,6 @@ void MessageFactoryTest::testCreateReplyUTF16Base64()
ident.setPrimaryEmailAddress(QStringLiteral("foo@foo.foo"));
identMan->commit();
TemplateParser::TemplateParserSettings::self()->setReplyUsingHtml(true);
// qDebug() << "plain base64 msg message:" << msg->encodedContent();
......@@ -434,13 +431,11 @@ void MessageFactoryTest::testCreateForwardMultiEmails()
MessageFactory factory(msg, 0);
factory.setIdentityManager(identMan);
KMime::Message::Ptr fw = factory.createForward();
QDateTime date = msg->date()->dateTime();
QString datetime = QLocale::system().toString(date.date(), QLocale::LongFormat);
datetime += QLatin1String(", ") + QLocale::system().toString(date.time(), QLocale::LongFormat);
QString fwdMsg = QString::fromLatin1(
"From: another <another@another.com>\n"
"Date: %2\n"
......@@ -647,7 +642,6 @@ void MessageFactoryTest::testCreateRedirectToAndCC()
//dir.removeRecursively();
}
void MessageFactoryTest::testCreateRedirect()
{
KMime::Message::Ptr msg = createPlainTestMessage();
......@@ -840,7 +834,6 @@ KMime::Message::Ptr MessageFactoryTest::createPlainTestMessageWithMultiEmails()
return message;
}
KMime::Message::Ptr MessageFactoryTest::loadMessageFromFile(QString filename)
{
QFile file(QLatin1String(QByteArray(MAIL_DATA_DIR "/" + filename.toLatin1())));
......
......@@ -40,7 +40,6 @@ private Q_SLOTS:
void testCreateRedirectToAndCC();
void testCreateRedirectToAndCCAndBCC();
//MultiPart
void test_multipartAlternative_data();
void test_multipartAlternative();
......
......@@ -105,7 +105,6 @@ MessageFactory::MessageReply MessageFactory::createReply()
MessageCore::MailingList::name(m_origMsg, headerName, mailingListStr);
replyToList = m_origMsg->replyTo()->mailboxes();
msg->contentType()->setCharset("utf-8");
if (auto hdr = m_origMsg->headerByType("List-Post")) {
......
......@@ -55,13 +55,13 @@ void QuoteHtmlTest::testQuoteHtml_data()
QTest::newRow("multispace") << QStringLiteral(" Bug ID: 358324") << QStringLiteral("<div class=\"noquote\"><div dir=\"ltr\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bug ID: 358324</div></div>") << false << 1;
QTest::newRow("bug-369072") << QStringLiteral("test\n>quote1\n>>quote2\n>>>quote3\n>>new quote2\n>new quote1\nnew text") <<
QStringLiteral("<div class=\"noquote\"><div dir=\"ltr\">test</div>"
"</div><blockquote><div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">></span><font color=\"#008000\">quote1</font></div>"
"</div><blockquote><div class=\"quotelevel2\"><div dir=\"ltr\"><span class=\"quotemarks\">>></span><font color=\"#007000\">quote2</font></div>"
"</div><blockquote><div class=\"quotelevel3\"><div dir=\"ltr\"><span class=\"quotemarks\">>>></span><font color=\"#006000\">quote3</font></div>"
"</div></blockquote><div class=\"quotelevel2\"><div dir=\"ltr\"><span class=\"quotemarks\">>></span><font color=\"#007000\">new quote2</font></div>"
"</div></blockquote><div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">></span><font color=\"#008000\">new quote1</font></div>"
"</div></blockquote><div class=\"noquote\"><div dir=\"ltr\">new text</div></div>") << false << 1;
QStringLiteral("<div class=\"noquote\"><div dir=\"ltr\">test</div>"
"</div><blockquote><div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">></span><font color=\"#008000\">quote1</font></div>"
"</div><blockquote><div class=\"quotelevel2\"><div dir=\"ltr\"><span class=\"quotemarks\">>></span><font color=\"#007000\">quote2</font></div>"
"</div><blockquote><div class=\"quotelevel3\"><div dir=\"ltr\"><span class=\"quotemarks\">>>></span><font color=\"#006000\">quote3</font></div>"
"</div></blockquote><div class=\"quotelevel2\"><div dir=\"ltr\"><span class=\"quotemarks\">>></span><font color=\"#007000\">new quote2</font></div>"
"</div></blockquote><div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">></span><font color=\"#008000\">new quote1</font></div>"
"</div></blockquote><div class=\"noquote\"><div dir=\"ltr\">new text</div></div>") << false << 1;
//Show Expand Quotes
QTest::newRow("simpletext-expand") << QStringLiteral("http") << QStringLiteral("<div class=\"noquote\"><div dir=\"ltr\">http</div></div>") << true << 1;
......@@ -71,41 +71,39 @@ void QuoteHtmlTest::testQuoteHtml_data()
QTest::newRow("simplespace-expand") << QStringLiteral(" ") << QStringLiteral("<div class=\"noquote\"><div dir=\"ltr\">&nbsp;</div></div>") << true << 1;
QTest::newRow("bug-369072-expand-quotelevel3") << QStringLiteral("test\n>quote1\n>>quote2\n>>>quote3\n>>new quote2\n>new quote1\nnew text") <<
QStringLiteral("<div class=\"noquote\"><div dir=\"ltr\">test</div>"
"</div><blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?0 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">></span><font color=\"#008000\">quote1</font></div></div><blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?1 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel2\"><div dir=\"ltr\"><span class=\"quotemarks\">>></span><font color=\"#007000\">quote2</font></div></div><blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?2 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel3\"><div dir=\"ltr\"><span class=\"quotemarks\">>>></span><font color=\"#006000\">quote3</font></div></div></blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?1 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel2\"><div dir=\"ltr\"><span class=\"quotemarks\">>></span><font color=\"#007000\">new quote2</font></div></div></blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?0 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">></span><font color=\"#008000\">new quote1</font></div></div></blockquote><div class=\"noquote\"><div dir=\"ltr\">new text</div></div>").arg(mCollapseIcon)
<< true << 3;
QStringLiteral("<div class=\"noquote\"><div dir=\"ltr\">test</div>"
"</div><blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?0 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">></span><font color=\"#008000\">quote1</font></div></div><blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?1 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel2\"><div dir=\"ltr\"><span class=\"quotemarks\">>></span><font color=\"#007000\">quote2</font></div></div><blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?2 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel3\"><div dir=\"ltr\"><span class=\"quotemarks\">>>></span><font color=\"#006000\">quote3</font></div></div></blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?1 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel2\"><div dir=\"ltr\"><span class=\"quotemarks\">>></span><font color=\"#007000\">new quote2</font></div></div></blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?0 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">></span><font color=\"#008000\">new quote1</font></div></div></blockquote><div class=\"noquote\"><div dir=\"ltr\">new text</div></div>").arg(mCollapseIcon)
<< true << 3;
QTest::newRow("bug-369072-expand-quotelevel2") << QStringLiteral("test\n>quote1\n>>quote2\n>>>quote3\n>>new quote2\n>new quote1\nnew text") <<
QStringLiteral("<div class=\"noquote\"><div dir=\"ltr\">test</div></div><blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?0 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">></span><font color=\"#008000\">quote1</font></div></div><blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?1 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel2\"><div dir=\"ltr\"><span class=\"quotemarks\">>></span><font color=\"#007000\">quote2</font></div></div><blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?-1 \"><img src=\"%2\"/></a></div><br/></blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?1 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel2\"><div dir=\"ltr\"><span class=\"quotemarks\">>></span><font color=\"#007000\">new quote2</font></div></div></blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?0 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">></span><font color=\"#008000\">new quote1</font></div></div></blockquote><div class=\"noquote\"><div dir=\"ltr\">new text</div></div>").arg(mCollapseIcon).arg(mExpandIcon)
<< true << 2;
QStringLiteral("<div class=\"noquote\"><div dir=\"ltr\">test</div></div><blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?0 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">></span><font color=\"#008000\">quote1</font></div></div><blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?1 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel2\"><div dir=\"ltr\"><span class=\"quotemarks\">>></span><font color=\"#007000\">quote2</font></div></div><blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?-1 \"><img src=\"%2\"/></a></div><br/></blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?1 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel2\"><div dir=\"ltr\"><span class=\"quotemarks\">>></span><font color=\"#007000\">new quote2</font></div></div></blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?0 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">></span><font color=\"#008000\">new quote1</font></div></div></blockquote><div class=\"noquote\"><div dir=\"ltr\">new text</div></div>").arg(mCollapseIcon).arg(mExpandIcon)
<< true << 2;
QTest::newRow("bug-369072-expand-quotelevel1") << QStringLiteral("test\n>quote1\n>>quote2\n>>>quote3\n>>new quote2\n>new quote1\nnew text") <<
QStringLiteral("<div class=\"noquote\"><div dir=\"ltr\">test</div></div><blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?0 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">></span><font color=\"#008000\">quote1</font></div></div><blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?-1 \"><img src=\"%2\"/></a></div><br/>"
"<blockquote></blockquote></blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?0 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">></span><font color=\"#008000\">new quote1</font></div></div></blockquote><div class=\"noquote\"><div dir=\"ltr\">new text</div></div>").arg(mCollapseIcon).arg(mExpandIcon)
<< true << 1;
QStringLiteral("<div class=\"noquote\"><div dir=\"ltr\">test</div></div><blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?0 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">></span><font color=\"#008000\">quote1</font></div></div><blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?-1 \"><img src=\"%2\"/></a></div><br/>"
"<blockquote></blockquote></blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?0 \"><img src=\"%1\"/></a></div>"
"<div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">></span><font color=\"#008000\">new quote1</font></div></div></blockquote><div class=\"noquote\"><div dir=\"ltr\">new text</div></div>").arg(mCollapseIcon).arg(mExpandIcon)
<< true << 1;
QTest::newRow("bug-370452") << QStringLiteral("test\n> blo\n>\n>\n>\n> bla\nnew text") <<
QStringLiteral("<div class=\"noquote\">"
"<div dir=\"ltr\">test</div></div>"
"<blockquote><div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">> </span><font color=\"#008000\">blo</font></div>"
"<div dir=\"ltr\"><span class=\"quotemarksemptyline\">></span></div>"
"<div dir=\"ltr\"><span class=\"quotemarksemptyline\">></span></div>"
"<div dir=\"ltr\"><span class=\"quotemarksemptyline\">></span></div>"
"<div dir=\"ltr\"><span class=\"quotemarks\">> </span><font color=\"#008000\">bla</font></div></div></blockquote>"
"<div class=\"noquote\"><div dir=\"ltr\">new text</div></div>") << false << 1;
QStringLiteral("<div class=\"noquote\">"
"<div dir=\"ltr\">test</div></div>"
"<blockquote><div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">> </span><font color=\"#008000\">blo</font></div>"
"<div dir=\"ltr\"><span class=\"quotemarksemptyline\">></span></div>"
"<div dir=\"ltr\"><span class=\"quotemarksemptyline\">></span></div>"
"<div dir=\"ltr\"><span class=\"quotemarksemptyline\">></span></div>"
"<div dir=\"ltr\"><span class=\"quotemarks\">> </span><font color=\"#008000\">bla</font></div></div></blockquote>"
"<div class=\"noquote\"><div dir=\"ltr\">new text</div></div>") << false << 1;
}
......
......@@ -688,7 +688,6 @@ public:
int currQuoteLevel = -2; // -2 == no previous lines
bool curHidden = false; // no hide any block
QString collapseIconPath;
QString mExpandIconPath;
if (source()->showExpandQuotesMark()) {
......
Supports Markdown
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