![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community, here is the log from the commit of package messagelib for openSUSE:Factory checked in at 2016-11-12 13:33:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/messagelib (Old) and /work/SRC/openSUSE:Factory/.messagelib.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "messagelib" Changes: -------- --- /work/SRC/openSUSE:Factory/messagelib/messagelib.changes 2016-10-18 10:14:22.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.messagelib.new/messagelib.changes 2016-11-12 13:33:13.000000000 +0100 @@ -1,0 +2,7 @@ +Wed Nov 9 06:12:14 UTC 2016 - lbeltrame@kde.org + +- Update to KDE Applications 16.08.3 + * KDE Applications 16.08.3 + * https://www.kde.org/announcements/announce-applications-16.08.3.php + +------------------------------------------------------------------- Old: ---- messagelib-16.08.2.tar.xz New: ---- messagelib-16.08.3.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ messagelib.spec ++++++ --- /var/tmp/diff_new_pack.VPYkSp/_old 2016-11-12 13:33:14.000000000 +0100 +++ /var/tmp/diff_new_pack.VPYkSp/_new 2016-11-12 13:33:14.000000000 +0100 @@ -17,7 +17,7 @@ Name: messagelib -Version: 16.08.2 +Version: 16.08.3 Release: 0 Summary: Base package of kdepim License: GPL-2.0 and GPL-3.0 and LGPL-2.1+ ++++++ messagelib-16.08.2.tar.xz -> messagelib-16.08.3.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/CMakeLists.txt new/messagelib-16.08.3/CMakeLists.txt --- old/messagelib-16.08.2/CMakeLists.txt 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/CMakeLists.txt 2016-11-04 13:20:36.000000000 +0100 @@ -18,28 +18,28 @@ include(ECMQtDeclareLoggingCategory) include(ECMAddTests) -set(PIM_VERSION "5.3.2") +set(PIM_VERSION "5.3.3") set(MESSAGELIB_LIB_VERSION ${PIM_VERSION}) -set(AKONADIMIME_LIB_VERSION "5.3.2") +set(AKONADIMIME_LIB_VERSION "5.3.3") set(QT_REQUIRED_VERSION "5.6.0") -set(AKONADI_VERSION "5.3.2") -set(AKONADINOTES_LIB_VERSION "5.3.2") -set(GRANTLEETHEME_LIB_VERSION "5.3.2") -set(GRAVATAR_LIB_VERSION "5.3.2") -set(IDENTITYMANAGEMENT_LIB_VERSION "5.3.2") -set(KCONTACTS_LIB_VERSION "5.3.2") -set(KDEPIM_APPS_LIB_VERSION "5.3.2") -set(KLDAP_LIB_VERSION "5.3.2") -set(KMAILTRANSPORT_LIB_VERSION "5.3.2") -set(KMBOX_LIB_VERSION "5.3.2") -set(KMIME_LIB_VERSION "5.3.2") -set(KPIMTEXTEDIT_LIB_VERSION "5.3.2") -set(LIBKDEPIM_LIB_VERSION "5.3.2") -set(LIBKLEO_LIB_VERSION "5.3.2") -set(PIMCOMMON_LIB_VERSION "5.3.2") +set(AKONADI_VERSION "5.3.3") +set(AKONADINOTES_LIB_VERSION "5.3.3") +set(GRANTLEETHEME_LIB_VERSION "5.3.3") +set(GRAVATAR_LIB_VERSION "5.3.3") +set(IDENTITYMANAGEMENT_LIB_VERSION "5.3.3") +set(KCONTACTS_LIB_VERSION "5.3.3") +set(KDEPIM_APPS_LIB_VERSION "5.3.3") +set(KLDAP_LIB_VERSION "5.3.3") +set(KMAILTRANSPORT_LIB_VERSION "5.3.3") +set(KMBOX_LIB_VERSION "5.3.3") +set(KMIME_LIB_VERSION "5.3.3") +set(KPIMTEXTEDIT_LIB_VERSION "5.3.3") +set(LIBKDEPIM_LIB_VERSION "5.3.3") +set(LIBKLEO_LIB_VERSION "5.3.3") +set(PIMCOMMON_LIB_VERSION "5.3.3") find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test Network PrintSupport WebEngine WebEngineWidgets WebKitWidgets) @@ -82,7 +82,7 @@ find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED) find_package(KF5SendLater ${KDEPIM_APPS_LIB_VERSION} CONFIG REQUIRED) -find_package(KF5AkonadiSearch "5.3.2" CONFIG REQUIRED) +find_package(KF5AkonadiSearch "5.3.3" CONFIG REQUIRED) set_package_properties(KF5AkonadiSearch PROPERTIES DESCRIPTION "The Akonadi Search libraries" URL "http://www.kde.org" TYPE REQUIRED PURPOSE "Provides search capabilities in KMail and Akonadi") option(KDEPIM_ENTERPRISE_BUILD "Enable features specific to the enterprise branch, which are normally disabled. Also, it disables many components not needed for Kontact such as the Kolab client." FALSE) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/messagelist/src/core/manager.cpp new/messagelib-16.08.3/messagelist/src/core/manager.cpp --- old/messagelib-16.08.2/messagelist/src/core/manager.cpp 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/messagelist/src/core/manager.cpp 2016-11-04 13:20:36.000000000 +0100 @@ -97,6 +97,7 @@ loadConfiguration(); connect(MessageListSettings::self(), &MessageListSettings::configChanged, this, &Manager::reloadGlobalConfiguration); + connect(MessageCore::MessageCoreSettings::self(), &MessageCore::MessageCoreSettings::configChanged, this, &Manager::reloadGlobalConfiguration); } Manager::~Manager() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/messagelist/src/pane.cpp new/messagelib-16.08.3/messagelist/src/pane.cpp --- old/messagelib-16.08.2/messagelist/src/pane.cpp 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/messagelist/src/pane.cpp 2016-11-04 13:20:36.000000000 +0100 @@ -252,7 +252,7 @@ d->mCloseTabAction = new QAction(i18n("Close Tab"), this); d->mXmlGuiClient->actionCollection()->addAction(QStringLiteral("close_current_tab"), d->mCloseTabAction); - d->mXmlGuiClient->actionCollection()->setDefaultShortcut(d->mCloseTabAction, QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W)); + d->mXmlGuiClient->actionCollection()->setDefaultShortcuts(d->mCloseTabAction, QList<QKeySequence>() << QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_W) << QKeySequence(Qt::CTRL + Qt::Key_W)); connect(d->mCloseTabAction, SIGNAL(triggered(bool)), SLOT(onCloseTabClicked())); d->mActionMenu->addAction(d->mCloseTabAction); d->mCloseTabAction->setEnabled(false); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/messageviewer/src/header/headerstyle_util.cpp new/messagelib-16.08.3/messageviewer/src/header/headerstyle_util.cpp --- old/messagelib-16.08.2/messageviewer/src/header/headerstyle_util.cpp 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/messageviewer/src/header/headerstyle_util.cpp 2016-11-04 13:20:36.000000000 +0100 @@ -63,21 +63,22 @@ // Prepare the date string (when printing always use the localized date) QString HeaderStyleUtil::dateString(KMime::Message *message, bool printing, HeaderStyleUtilDateFormat dateFormat) const -{ +{ const QDateTime dateTime = message->date()->dateTime(); + const time_t unixTime = dateTime.toTime_t(); if (!dateTime.isValid()) { return i18nc("Unknown date", "Unknown"); } if (printing) { - return QLocale::system().toString(dateTime, QLocale::ShortFormat); + return KMime::DateFormatter::formatDate(KMime::DateFormatter::Localized, unixTime); } else { switch (dateFormat) { case ShortDate: - return QLocale::system().toString(dateTime, QLocale::ShortFormat); + return KMime::DateFormatter::formatDate(KMime::DateFormatter::Localized, unixTime); case LongDate: - return QLocale::system().toString(dateTime, QLocale::LongFormat); + return KMime::DateFormatter::formatDate(KMime::DateFormatter::CTime, unixTime);; case FancyShortDate: - return dateShortStr(dateTime); + return KMime::DateFormatter::formatDate(KMime::DateFormatter::Fancy, unixTime);; case FancyLongDate: //Laurent fix me //TODO return QLocale::system().toString(dateTime, QLocale::LongFormat); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/messageviewer/src/header/plainheaderstyle.cpp new/messagelib-16.08.3/messageviewer/src/header/plainheaderstyle.cpp --- old/messagelib-16.08.2/messageviewer/src/header/plainheaderstyle.cpp 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/messageviewer/src/header/plainheaderstyle.cpp 2016-11-04 13:20:36.000000000 +0100 @@ -141,13 +141,19 @@ headerStr.append(i18nc("To-field of the mailheader.", "To: ") + StringUtil::emailAddrAsAnchor(message->to(), StringUtil::DisplayFullAddress) + QLatin1String("<br/>\n")); - if (strategy->showHeader(QStringLiteral("cc")) && message->cc(false)) - headerStr.append(i18n("CC: ") + - StringUtil::emailAddrAsAnchor(message->cc(), StringUtil::DisplayFullAddress) + QLatin1String("<br/>\n")); + if (strategy->showHeader(QStringLiteral("cc")) && message->cc(false)) { + const QString str = StringUtil::emailAddrAsAnchor(message->cc(), StringUtil::DisplayFullAddress); + if (!str.isEmpty()) { + headerStr.append(i18n("CC: ") + str + QLatin1String("<br/>\n")); + } + } - if (strategy->showHeader(QStringLiteral("bcc")) && message->bcc(false)) - headerStr.append(i18n("BCC: ") + - StringUtil::emailAddrAsAnchor(message->bcc(), StringUtil::DisplayFullAddress) + QLatin1String("<br/>\n")); + if (strategy->showHeader(QStringLiteral("bcc")) && message->bcc(false)) { + const QString str = StringUtil::emailAddrAsAnchor(message->bcc(), StringUtil::DisplayFullAddress); + if (!str.isEmpty()) { + headerStr.append(i18n("BCC: ") + str + QLatin1String("<br/>\n")); + } + } if (strategy->showHeader(QStringLiteral("reply-to")) && message->replyTo(false)) headerStr.append(i18n("Reply to: ") + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/messageviewer/src/messagepartthemes/default/autotests/quotehtmltest.cpp new/messagelib-16.08.3/messageviewer/src/messagepartthemes/default/autotests/quotehtmltest.cpp --- old/messagelib-16.08.2/messageviewer/src/messagepartthemes/default/autotests/quotehtmltest.cpp 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/messageviewer/src/messagepartthemes/default/autotests/quotehtmltest.cpp 2016-11-04 13:20:36.000000000 +0100 @@ -25,6 +25,7 @@ #include <MimeTreeParser/HtmlWriter> #include <MessageViewer/CSSHelperBase> #include <MimeTreeParser/MessagePart> +#include <MessageViewer/IconNameCache> #include <QTest> @@ -35,30 +36,83 @@ void QuoteHtmlTest::initTestCase() { MessageViewer::Test::setupEnv(); + mCollapseIcon = MessageViewer::IconNameCache::instance()->iconPathFromLocal(QStringLiteral("quotecollapse.png")); + mExpandIcon = MessageViewer::IconNameCache::instance()->iconPathFromLocal(QStringLiteral("quoteexpand.png")); } void QuoteHtmlTest::testQuoteHtml_data() { QTest::addColumn<QString>("data"); QTest::addColumn<QString>("result"); - QTest::newRow("simpletext") << QStringLiteral("http") << QStringLiteral("<div class=\"noquote\"><div dir=\"ltr\">http</div></div>"); - QTest::newRow("simplequote") << QStringLiteral(">") << QStringLiteral("<blockquote><div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">></span></div></div></blockquote>"); - QTest::newRow("doublequotewithtext") << QStringLiteral(">> sddf") << QStringLiteral("<blockquote><blockquote><div class=\"quotelevel2\"><div dir=\"ltr\"><span class=\"quotemarks\">>> </span><font color=\"#007000\">sddf</font></div></div></blockquote></blockquote>"); - QTest::newRow("doublequote") << QStringLiteral(">>") << QStringLiteral("<blockquote><blockquote><div class=\"quotelevel2\"><div dir=\"ltr\"><span class=\"quotemarks\">>></span></div></div></blockquote></blockquote>"); - QTest::newRow("simplespace") << QStringLiteral(" ") << QStringLiteral("<div class=\"noquote\"><div dir=\"ltr\"> </div></div>"); - QTest::newRow("multispace") << QStringLiteral(" Bug ID: 358324") << QStringLiteral("<div class=\"noquote\"><div dir=\"ltr\"> Bug ID: 358324</div></div>"); + QTest::addColumn<bool>("showExpandQuotesMark"); + QTest::addColumn<int>("quotelevel"); + //No Expand Quotes + QTest::newRow("simpletext") << QStringLiteral("http") << QStringLiteral("<div class=\"noquote\"><div dir=\"ltr\">http</div></div>") << false << 1; + QTest::newRow("simplequote") << QStringLiteral(">") << QStringLiteral("<blockquote><div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">></span></div></div></blockquote>") << false << 1; + QTest::newRow("doublequotewithtext") << QStringLiteral(">> sddf") << QStringLiteral("<blockquote><blockquote><div class=\"quotelevel2\"><div dir=\"ltr\"><span class=\"quotemarks\">>> </span><font color=\"#007000\">sddf</font></div></div></blockquote></blockquote>") << false << 1; + QTest::newRow("doublequote") << QStringLiteral(">>") << QStringLiteral("<blockquote><blockquote><div class=\"quotelevel2\"><div dir=\"ltr\"><span class=\"quotemarks\">>></span></div></div></blockquote></blockquote>") << false << 1; + QTest::newRow("simplespace") << QStringLiteral(" ") << QStringLiteral("<div class=\"noquote\"><div dir=\"ltr\"> </div></div>") << false << 1; + QTest::newRow("multispace") << QStringLiteral(" Bug ID: 358324") << QStringLiteral("<div class=\"noquote\"><div dir=\"ltr\"> 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; + + //Show Expand Quotes + QTest::newRow("simpletext-expand") << QStringLiteral("http") << QStringLiteral("<div class=\"noquote\"><div dir=\"ltr\">http</div></div>") << true << 1; + + QString result = QStringLiteral("<blockquote><div class=\"quotelevelmark\" ><a href=\"kmail:levelquote?0 \"><img src=\"%1\"/></a></div><div class=\"quotelevel1\"><div dir=\"ltr\"><span class=\"quotemarks\">></span></div></div></blockquote>").arg(mCollapseIcon); + QTest::newRow("simplequote-expand") << QStringLiteral(">") << result << true << 1; + QTest::newRow("simplespace-expand") << QStringLiteral(" ") << QStringLiteral("<div class=\"noquote\"><div dir=\"ltr\"> </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; + + 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; + + 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; + } void QuoteHtmlTest::testQuoteHtml() { QFETCH(QString, data); QFETCH(QString, result); + QFETCH(bool, showExpandQuotesMark); + QFETCH(int, quotelevel); Test::HtmlWriter testWriter; Test::CSSHelper testCSSHelper; Test::ObjectTreeSource emptySource(&testWriter, &testCSSHelper); + emptySource.setShowExpandQuotesMark(showExpandQuotesMark); + emptySource.setLevelQuote(quotelevel); + MimeTreeParser::ObjectTreeParser otp(&emptySource); MimeTreeParser::MessagePart::Ptr part(new MimeTreeParser::MessagePart(&otp, data)); DefaultRenderer renderer(part, &testCSSHelper); + //qDebug()<<"renderer.html() "<<renderer.html(); QCOMPARE(renderer.html(), result); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/messageviewer/src/messagepartthemes/default/autotests/quotehtmltest.h new/messagelib-16.08.3/messageviewer/src/messagepartthemes/default/autotests/quotehtmltest.h --- old/messagelib-16.08.2/messageviewer/src/messagepartthemes/default/autotests/quotehtmltest.h 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/messageviewer/src/messagepartthemes/default/autotests/quotehtmltest.h 2016-11-04 13:20:36.000000000 +0100 @@ -31,6 +31,9 @@ private Q_SLOTS: void testQuoteHtml(); void testQuoteHtml_data(); +private: + QString mCollapseIcon; + QString mExpandIcon; }; #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/messageviewer/src/messagepartthemes/default/autotests/setupenv.h new/messagelib-16.08.3/messageviewer/src/messagepartthemes/default/autotests/setupenv.h --- old/messagelib-16.08.2/messageviewer/src/messagepartthemes/default/autotests/setupenv.h 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/messageviewer/src/messagepartthemes/default/autotests/setupenv.h 2016-11-04 13:20:36.000000000 +0100 @@ -54,7 +54,10 @@ , mAttachmentStrategy(QStringLiteral("smart")) , mHtmlLoadExternal(false) , mDecryptMessage(false) + , mShowSignatureDetails(false) + , mShowExpandQuotesMark(false) , mPreferredMode(MimeTreeParser::Util::Html) + , mQuoteLevel(1) { } @@ -95,9 +98,14 @@ return false; } + void setShowExpandQuotesMark(bool b) + { + mShowExpandQuotesMark = b; + } + bool showExpandQuotesMark() const Q_DECL_OVERRIDE { - return false; + return mShowExpandQuotesMark; } const MimeTreeParser::BodyPartFormatterBaseFactory *bodyPartFormatterFactory() Q_DECL_OVERRIDE { @@ -139,7 +147,12 @@ int levelQuote() const Q_DECL_OVERRIDE { - return 1; + return mQuoteLevel; + } + + void setLevelQuote(int level) + { + mQuoteLevel = level; } const QTextCodec *overrideCodec() Q_DECL_OVERRIDE { @@ -163,7 +176,9 @@ bool mHtmlLoadExternal; bool mDecryptMessage; bool mShowSignatureDetails; + bool mShowExpandQuotesMark; MimeTreeParser::Util::HtmlMode mPreferredMode; + int mQuoteLevel; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp new/messagelib-16.08.3/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp --- old/messagelib-16.08.2/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/messageviewer/src/messagepartthemes/default/defaultrenderer.cpp 2016-11-04 13:20:36.000000000 +0100 @@ -65,17 +65,6 @@ Q_DECLARE_METATYPE(GpgME::DecryptionResult::Recipient) Q_DECLARE_METATYPE(const Kleo::CryptoBackend::Protocol *) -static QString iconToDataUrl(const QString &iconPath) -{ - QFile f(iconPath); - if (!f.open(QIODevice::ReadOnly)) { - return QString(); - } - - const QByteArray ba = f.readAll(); - return QStringLiteral("data:image/png;base64,%1").arg(QLatin1String(ba.toBase64().constData())); -} - /** Check if the newline at position @p newLinePos in string @p s seems to separate two paragraphs (important for correct BiDi behavior, but is heuristic because paragraphs are not @@ -700,14 +689,12 @@ int currQuoteLevel = -2; // -2 == no previous lines bool curHidden = false; // no hide any block + + QString collapseIconPath; + QString mExpandIconPath; if (source()->showExpandQuotesMark()) { - // Cache Icons - if (mCollapseIcon.isEmpty()) { - mCollapseIcon = iconToDataUrl(IconNameCache::instance()->iconPath(QStringLiteral("quotecollapse"), 0)); - } - if (mExpandIcon.isEmpty()) { - mExpandIcon = iconToDataUrl(IconNameCache::instance()->iconPath(QStringLiteral("quoteexpand"), 0)); - } + collapseIconPath = IconNameCache::instance()->iconPathFromLocal(QStringLiteral("quotecollapse.png")); + mExpandIconPath = IconNameCache::instance()->iconPathFromLocal(QStringLiteral("quoteexpand.png")); } int previousQuoteDepth = -1; @@ -751,7 +738,7 @@ // This quoted line needs be hidden if (source()->showExpandQuotesMark() && source()->levelQuote() >= 0 - && source()->levelQuote() <= (actQuoteLevel)) { + && source()->levelQuote() <= actQuoteLevel) { actHidden = true; } @@ -764,7 +751,7 @@ } //Close blockquote if (previousQuoteDepth > actQuoteLevel) { - htmlStr += cssHelper()->addEndBlockQuote((previousQuoteDepth - actQuoteLevel)); + htmlStr += cssHelper()->addEndBlockQuote(previousQuoteDepth - actQuoteLevel); } /* start new quotelevel */ @@ -772,6 +759,10 @@ htmlStr += normalStartTag; } else { if (source()->showExpandQuotesMark()) { + // Add blockquote + if (previousQuoteDepth < actQuoteLevel) { + htmlStr += cssHelper()->addStartBlockQuote(actQuoteLevel - previousQuoteDepth); + } if (actHidden) { //only show the QuoteMark when is the first line of the level hidden if (!curHidden) { @@ -780,16 +771,15 @@ htmlStr += QStringLiteral("<a href=\"kmail:levelquote?%1 \">" "<img src=\"%2\"/></a>") .arg(-1) - .arg(mExpandIcon); + .arg(mExpandIconPath); htmlStr += QLatin1String("</div><br/>"); - htmlStr += quoteEnd; } } else { htmlStr += QLatin1String("<div class=\"quotelevelmark\" >"); htmlStr += QStringLiteral("<a href=\"kmail:levelquote?%1 \">" "<img src=\"%2\"/></a>") .arg(actQuoteLevel) - .arg(mCollapseIcon); + .arg(collapseIconPath); htmlStr += QLatin1String("</div>"); if (actQuoteLevel < 3) { htmlStr += quoteFontTag[actQuoteLevel]; @@ -797,11 +787,6 @@ htmlStr += deepQuoteFontTag[actQuoteLevel % 3]; } } - // Add blockquote - if (previousQuoteDepth < actQuoteLevel) { - htmlStr += cssHelper()->addStartBlockQuote(actQuoteLevel - previousQuoteDepth); - } - } else { // Add blockquote if (previousQuoteDepth < actQuoteLevel) { @@ -830,10 +815,12 @@ // if quoteLengh == 0 && foundQuote => a simple quote if (foundQuote) { quoteLength++; - htmlStr += QStringLiteral("<span class=\"quotemarks\">%1</span>").arg(line.left(quoteLength)); const int rightString = (line.length()) - quoteLength; if (rightString > 0) { + htmlStr += QStringLiteral("<span class=\"quotemarks\">%1</span>").arg(line.left(quoteLength)); htmlStr += QStringLiteral("<font color=\"%1\">").arg(cssHelper()->quoteColorName(actQuoteLevel)) + KTextToHTML::convertToHtml(line.right(rightString), convertFlags) + QStringLiteral("</font>"); + } else { + htmlStr += QStringLiteral("<span class=\"quotemarksemptyline\">%1</span>").arg(line.left(quoteLength)); } } else { htmlStr += KTextToHTML::convertToHtml(line, convertFlags); @@ -1407,8 +1394,6 @@ HtmlWriter *mOldWriter; CSSHelperBase *mCSSHelper; - QString mCollapseIcon; - QString mExpandIcon; }; DefaultRenderer::DefaultRenderer(const MimeTreeParser::Interface::MessagePart::Ptr &msgPart, CSSHelperBase *cssHelper) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/messageviewer/src/messageviewerheaderplugins/standardsheaderstyleplugin/standardheaderstrategy.cpp new/messagelib-16.08.3/messageviewer/src/messageviewerheaderplugins/standardsheaderstyleplugin/standardheaderstrategy.cpp --- old/messagelib-16.08.2/messageviewer/src/messageviewerheaderplugins/standardsheaderstyleplugin/standardheaderstrategy.cpp 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/messageviewer/src/messageviewerheaderplugins/standardsheaderstyleplugin/standardheaderstrategy.cpp 2016-11-04 13:20:36.000000000 +0100 @@ -21,7 +21,7 @@ using namespace MessageViewer; static const char *const standardHeaders[] = { - "subject", "from", "cc", "bcc", "to" + "subject", "from", "cc", "bcc", "to", "date" }; static const int numStandardHeaders = sizeof standardHeaders / sizeof * standardHeaders; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/messageviewer/src/notify/messageviewer.notifyrc new/messagelib-16.08.3/messageviewer/src/notify/messageviewer.notifyrc --- old/messagelib-16.08.2/messageviewer/src/notify/messageviewer.notifyrc 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/messageviewer/src/notify/messageviewer.notifyrc 2016-11-04 13:20:36.000000000 +0100 @@ -4,6 +4,7 @@ Comment[ast]=Visor de mensaxes Comment[ca]=Visor del missatge Comment[ca@valencia]=Visor del missatge +Comment[cs]=Prohlížeč zpráv Comment[da]=Brevfremviser Comment[de]=Nachrichtenanzeige Comment[en_GB]=Message Viewer @@ -34,6 +35,7 @@ Name=New Ad-Block list download done Name[ca]=La baixada de la nova llista de bloqueig publicitari ha finalitzat Name[ca@valencia]=La baixada de la nova llista de bloqueig publicitari ha finalitzat +Name[cs]=Stažení nového seznamu pro Ad-Block dokončeno Name[da]=Download af ny Ad-Block-liste gennemført Name[de]=Das Herunterladen der neuen Werbefilterliste ist abgeschlossen Name[en_GB]=New Ad-Block list download done @@ -62,6 +64,7 @@ Comment=New Ad-Block list download done Comment[ca]=La baixada de la nova llista de bloqueig publicitari ha finalitzat Comment[ca@valencia]=La baixada de la nova llista de bloqueig publicitari ha finalitzat +Comment[cs]=Stažení nového seznamu pro Ad-Block dokončeno Comment[da]=Download af ny Ad-Block-liste gennemført Comment[de]=Das Herunterladen der neuen Werbefilterliste ist abgeschlossen Comment[en_GB]=New Ad-Block list download done @@ -93,6 +96,7 @@ Name=New Ad-Block list download failed Name[ca]=La baixada de la nova llista de bloqueig publicitari ha fallat Name[ca@valencia]=La baixada de la nova llista de bloqueig publicitari ha fallat +Name[cs]=Stažení nového seznamu pro Ad-Block selhalo Name[da]=Download af ny Ad-Block-liste mislykkedes Name[de]=Das Herunterladen der neuen Werbefilterliste ist fehlgeschlagen Name[en_GB]=New Ad-Block list download failed @@ -120,6 +124,7 @@ Comment=New Ad-Block list download failed Comment[ca]=La baixada de la nova llista de bloqueig publicitari ha fallat Comment[ca@valencia]=La baixada de la nova llista de bloqueig publicitari ha fallat +Comment[cs]=Stažení nového seznamu pro Ad-Block selhalo Comment[da]=Download af ny Ad-Block-liste mislykkedes Comment[de]=Das Herunterladen der neuen Werbefilterliste ist fehlgeschlagen Comment[en_GB]=New Ad-Block list download failed diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/messageviewer/src/utils/iconnamecache.cpp new/messagelib-16.08.3/messageviewer/src/utils/iconnamecache.cpp --- old/messagelib-16.08.2/messageviewer/src/utils/iconnamecache.cpp 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/messageviewer/src/utils/iconnamecache.cpp 2016-11-04 13:20:36.000000000 +0100 @@ -20,6 +20,7 @@ #include "iconnamecache.h" #include <KIconLoader> +#include <QStandardPaths> using namespace MessageViewer; @@ -53,4 +54,27 @@ const QString fileName = KIconLoader::global()->iconPath(name, size); mCachedEntries.insert(entry, fileName); return fileName; -} \ No newline at end of file +} + +QString IconNameCache::iconPathFromLocal(const QString &name) const +{ + Entry entry; + entry.fileName = name; + entry.size = 0; + + if (mCachedEntries.contains(entry)) { + return mCachedEntries.value(entry); + } + + const QString fileName = picsPath() + name; + mCachedEntries.insert(entry, fileName); + return fileName; +} + +QString IconNameCache::picsPath() const +{ + if (mPicsPath.isEmpty()) { + mPicsPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("libmessageviewer/pics/"), QStandardPaths::LocateDirectory); + } + return mPicsPath; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/messageviewer/src/utils/iconnamecache.h new/messagelib-16.08.3/messageviewer/src/utils/iconnamecache.h --- old/messagelib-16.08.2/messageviewer/src/utils/iconnamecache.h 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/messageviewer/src/utils/iconnamecache.h 2016-11-04 13:20:36.000000000 +0100 @@ -39,8 +39,10 @@ static IconNameCache *instance(); QString iconPath(const QString &name, int size) const; + QString iconPathFromLocal(const QString &name) const; private: + QString picsPath() const; class Entry { @@ -52,6 +54,7 @@ }; mutable QMap<Entry, QString> mCachedEntries; + mutable QString mPicsPath; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/messageviewer/src/utils/messageviewerutil.cpp new/messagelib-16.08.3/messageviewer/src/utils/messageviewerutil.cpp --- old/messagelib-16.08.2/messageviewer/src/utils/messageviewerutil.cpp 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/messageviewer/src/utils/messageviewerutil.cpp 2016-11-04 13:20:36.000000000 +0100 @@ -154,7 +154,8 @@ QUrl localUrl = KFileWidget::getStartUrl(QUrl(QStringLiteral("kfiledialog:///attachmentDir")), recentDirClass); localUrl.setPath(localUrl.path() + QLatin1Char('/') + fileName); - url = QFileDialog::getSaveFileUrl(parent, i18n("Save Attachment"), localUrl); + QFileDialog::Options options = QFileDialog::DontConfirmOverwrite; + url = QFileDialog::getSaveFileUrl(parent, i18n("Save Attachment"), localUrl, QString(), Q_NULLPTR, options); if (url.isEmpty()) { return false; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/messageviewer/src/viewer/csshelperbase.cpp new/messagelib-16.08.3/messageviewer/src/viewer/csshelperbase.cpp --- old/messagelib-16.08.2/messageviewer/src/viewer/csshelperbase.cpp 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/messageviewer/src/viewer/csshelperbase.cpp 2016-11-04 13:20:36.000000000 +0100 @@ -332,6 +332,11 @@ " color:transparent;\n" " font-size:0px;\n" "}\n\n"); + quoteCSS += QLatin1String(".quotemarksemptyline{\n" + " color:transparent;\n" + " font-size:0px;\n" + " line-height: 12pt;\n" + "}\n\n"); return quoteCSS; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/messageviewer/src/viewer/viewer_p.cpp new/messagelib-16.08.3/messageviewer/src/viewer/viewer_p.cpp --- old/messagelib-16.08.2/messageviewer/src/viewer/viewer_p.cpp 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/messageviewer/src/viewer/viewer_p.cpp 2016-11-04 13:20:36.000000000 +0100 @@ -27,6 +27,7 @@ #include "viewer/objecttreeemptysource.h" #include "viewer/objecttreeviewersource.h" #include "messagedisplayformatattribute.h" +#include "utils/iconnamecache.h" #include "scamdetection/scamdetectionwarningwidget.h" #include "scamdetection/scamattribute.h" #include "viewer/mimeparttree/mimeparttreeview.h" @@ -1265,7 +1266,6 @@ mViewerPluginToolManager->closeAllTools(); mScamDetectionWarning->setVisible(false); mOpenAttachmentFolderWidget->setVisible(false); - mDisplayFormatMessageOverwrite = (mDisplayFormatMessageOverwrite == MessageViewer::Viewer::UseGlobalSetting) ? MessageViewer::Viewer::UseGlobalSetting : MessageViewer::Viewer::Unknown; if (mPrinting) { if (MessageViewer::MessageViewerSettings::self()->respectExpandCollapseSettings()) { @@ -1277,6 +1277,8 @@ } else { mLevelQuote = -1; } + } else { + mDisplayFormatMessageOverwrite = (mDisplayFormatMessageOverwrite == MessageViewer::Viewer::UseGlobalSetting) ? MessageViewer::Viewer::UseGlobalSetting : MessageViewer::Viewer::Unknown; } } @@ -2046,6 +2048,7 @@ const int pos = (availableModes.indexOf(mode) + 1) % availableModes.size(); setDisplayFormatMessageOverwrite(translateToDisplayFormat(availableModes[pos])); update(MimeTreeParser::Force); + mColorBar->setAvailableModes(availableModes); } void ViewerPrivate::slotFind() @@ -2298,14 +2301,6 @@ } } -QString ViewerPrivate::picsPath() -{ - if (mPicsPath.isEmpty()) { - mPicsPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("libmessageviewer/pics/"), QStandardPaths::LocateDirectory); - } - return mPicsPath; -} - HeaderStylePlugin *ViewerPrivate::headerStylePlugin() const { return mHeaderStylePlugin; @@ -2320,7 +2315,6 @@ return QString(); } - QString imgpath(picsPath()); const QString urlHandleShow = QStringLiteral("kmail:showAttachmentQuicklist"); const QString imgSrcShow = QStringLiteral("quicklistClosed.png"); const QString urlHandleHide = QStringLiteral("kmail:hideAttachmentQuicklist"); @@ -2337,10 +2331,10 @@ const QString visibility = QStringLiteral("style=\"display:none;\""); link += QStringLiteral("<div style=\"text-align: %1;\">").arg(textAlign) + QStringLiteral("<a id=\"kmailshowattachment\" href=\"%1\" %2>").arg(urlHandleShow).arg(mShowAttachmentQuicklist ? QString() : visibility) + - QStringLiteral("<img src=\"%1\">").arg(QUrl::fromLocalFile(imgpath + imgSrcShow).url()) + + QStringLiteral("<img src=\"%1\">").arg(QUrl::fromLocalFile(MessageViewer::IconNameCache::instance()->iconPathFromLocal(imgSrcShow)).url()) + QStringLiteral("</a>") + QStringLiteral("<a id=\"kmailhideattachment\" href=\"%1\" %2>").arg(urlHandleHide).arg(mShowAttachmentQuicklist ? visibility : QString()) + - QStringLiteral("<img src=\"%1\">").arg(QUrl::fromLocalFile(imgpath + imgSrcHide).url()) + + QStringLiteral("<img src=\"%1\">").arg(QUrl::fromLocalFile(MessageViewer::IconNameCache::instance()->iconPathFromLocal(imgSrcHide)).url()) + QStringLiteral("</a>") + QStringLiteral("</div>"); @@ -2796,7 +2790,6 @@ QString ViewerPrivate::recipientsQuickListLinkHtml(const QString &field) { - const QString imgpath(picsPath()); const QString urlHandleShow = QLatin1String("kmail:hideFull") + field + QLatin1String("AddressList"); const QString imgSrcShow = QStringLiteral("quicklistOpened.png"); const QString urlHandleHide = QLatin1String("kmail:showFull") + field + QLatin1String("AddressList"); @@ -2810,10 +2803,10 @@ #endif return QStringLiteral("<span style=\"text-align: right;\">") + QStringLiteral("<a id=\"kmail%2show\" href=\"%1\">").arg(urlHandleShow).arg(field) + - QStringLiteral("<img src=\"%1\" alt=\"%2\" />").arg(QUrl::fromLocalFile(imgpath + imgSrcShow).url(), /*altTextShow*/QString()) + + QStringLiteral("<img src=\"%1\" alt=\"%2\" />").arg(QUrl::fromLocalFile(MessageViewer::IconNameCache::instance()->iconPathFromLocal(imgSrcShow)).url(), /*altTextShow*/QString()) + QStringLiteral("</a>") + QStringLiteral("<a id=\"kmail%2hide\" href=\"%1\" %3>").arg(urlHandleHide).arg(field).arg(visibility) + - QStringLiteral("<img src=\"%1\" alt=\"%2\" />").arg(QUrl::fromLocalFile(imgpath + imgSrcHide).url(), /*altTextHide*/QString()) + + QStringLiteral("<img src=\"%1\" alt=\"%2\" />").arg(QUrl::fromLocalFile(MessageViewer::IconNameCache::instance()->iconPathFromLocal(imgSrcHide)).url(), /*altTextHide*/QString()) + QStringLiteral("</a>") + QStringLiteral("</span>"); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/messageviewer/src/viewer/viewer_p.h new/messagelib-16.08.3/messageviewer/src/viewer/viewer_p.h --- old/messagelib-16.08.2/messageviewer/src/viewer/viewer_p.h 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/messageviewer/src/viewer/viewer_p.h 2016-11-04 13:20:36.000000000 +0100 @@ -581,7 +581,6 @@ void addHelpTextAction(QAction *act, const QString &text); void readGravatarConfig(); - QString picsPath(); public: MimeTreeParser::NodeHelper *mNodeHelper; bool mHtmlMailGlobalSetting; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/mimetreeparser/src/bodyformatter/utils.cpp new/messagelib-16.08.3/mimetreeparser/src/bodyformatter/utils.cpp --- old/messagelib-16.08.2/mimetreeparser/src/bodyformatter/utils.cpp 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/mimetreeparser/src/bodyformatter/utils.cpp 2016-11-04 13:20:36.000000000 +0100 @@ -56,7 +56,8 @@ const auto m = mp.dynamicCast<MessagePart>(); const auto text = mp.dynamicCast<TextMessagePart>(); const auto alternative = mp.dynamicCast<AlternativeMessagePart>(); - if (text) { + const auto attach = mp.dynamicCast<AttachmentMessagePart>(); + if (text && !attach) { return text; } else if (alternative) { return alternative; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/templateparser/autotests/data/html-attachment1.mbox new/messagelib-16.08.3/templateparser/autotests/data/html-attachment1.mbox --- old/messagelib-16.08.2/templateparser/autotests/data/html-attachment1.mbox 1970-01-01 01:00:00.000000000 +0100 +++ new/messagelib-16.08.3/templateparser/autotests/data/html-attachment1.mbox 2016-11-04 13:20:36.000000000 +0100 @@ -0,0 +1,84 @@ +Return-path: <sender@example.com> +Envelope-to: gunter@ohrner.net +Delivery-date: Mon, 12 Sep 2016 13:38:39 +0200 +Received: from mail.from example.com ([178.251.88.150]) + by luggage.ohrner.net with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) + (Exim 4.80) + (envelope-from <sender@example.com>) + id 1bjPYi-0000oA-Re + for gunter@ohrner.net; Mon, 12 Sep 2016 13:38:39 +0200 +Received: from example.com.local (172.17.124.205) by from example.com.local + (172.17.124.1) with Microsoft SMTP Server id 14.3.266.1; Mon, 12 Sep 2016 + 13:37:53 +0200 +From: <sender@example.com> +To: <receiver@example.com> +Message-ID: <8614416.18.1473680273823.JavaMail.sender@example.com> +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_Part_16_9312243.1473680273820" +Date: Mon, 12 Sep 2016 13:37:53 +0200 +X-TM-AS-Product-Ver: SMEX-11.1.0.1278-8.000.1202-22570.004 +X-TM-AS-Result: No--23.664000-5.000000-31 +X-TM-AS-User-Approved-Sender: No +X-TM-AS-User-Blocked-Sender: No +Subject: A Subject Line + +------=_Part_16_9312243.1473680273820 +Content-Type: text/html; charset="utf-8" +Content-Transfer-Encoding: 8bit + +<html><head></head><body><p><span style="font-family:Arial;">A Body Text</span></p></body></html> +------=_Part_16_9312243.1473680273820 +Content-Type: application/octet-stream; + name="Attachment1.pdf" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment + +JVBERi0xLjEKJeLjz9MKMSAwIG9iaiAKPDwKL1R5cGUgL0NhdGFsb2cKL1BhZ2VzIDIgMCBSCj4+ +CmVuZG9iaiAKMiAwIG9iaiAKPDwKL0tpZHMgWzMgMCBSXQovVHlwZSAvUGFnZXMKL01lZGlhQm94 +IFswIDAgMzAwIDE0NF0KL0NvdW50IDEKPj4KZW5kb2JqIAozIDAgb2JqIAo8PAovUmVzb3VyY2Vz +IAo8PAovRm9udCAKPDwKL0YxIAo8PAovU3VidHlwZSAvVHlwZTEKL1R5cGUgL0ZvbnQKL0Jhc2VG +b250IC9UaW1lcy1Sb21hbgo+Pgo+Pgo+PgovQ29udGVudHMgNCAwIFIKL1BhcmVudCAyIDAgUgov +VHlwZSAvUGFnZQovTWVkaWFCb3ggWzAgMCAzMDAgMTQ0XQo+PgplbmRvYmogCjQgMCBvYmogCjw8 +Ci9GaWx0ZXIgL0ZsYXRlRGVjb2RlCi9MZW5ndGggNTIKPj4Kc3RyZWFtCnicU1BwCuFSAAJ9N0MF +QwuFkDQwzwAIQ1LATA2P1JycfIXw/KKcFE2FkCygoGsIACsbDAQKZW5kc3RyZWFtIAplbmRvYmog +eHJlZgowIDUKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDE1IDAwMDAwIG4gCjAwMDAwMDAw +NjYgMDAwMDAgbiAKMDAwMDAwMDE0OSAwMDAwMCBuIAowMDAwMDAwMzMxIDAwMDAwIG4gCnRyYWls +ZXIKCjw8Ci9Sb290IDEgMCBSCi9TaXplIDUKPj4Kc3RhcnR4cmVmCjQ1NgolJUVPRgo= + +------=_Part_16_9312243.1473680273820 +Content-Type: application/octet-stream; name="Attachment2.pdf" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment + +JVBERi0xLjEKJeLjz9MKMSAwIG9iaiAKPDwKL1R5cGUgL0NhdGFsb2cKL1BhZ2VzIDIgMCBSCj4+ +CmVuZG9iaiAKMiAwIG9iaiAKPDwKL0tpZHMgWzMgMCBSXQovVHlwZSAvUGFnZXMKL01lZGlhQm94 +IFswIDAgMzAwIDE0NF0KL0NvdW50IDEKPj4KZW5kb2JqIAozIDAgb2JqIAo8PAovUmVzb3VyY2Vz +IAo8PAovRm9udCAKPDwKL0YxIAo8PAovU3VidHlwZSAvVHlwZTEKL1R5cGUgL0ZvbnQKL0Jhc2VG +b250IC9UaW1lcy1Sb21hbgo+Pgo+Pgo+PgovQ29udGVudHMgNCAwIFIKL1BhcmVudCAyIDAgUgov +VHlwZSAvUGFnZQovTWVkaWFCb3ggWzAgMCAzMDAgMTQ0XQo+PgplbmRvYmogCjQgMCBvYmogCjw8 +Ci9GaWx0ZXIgL0ZsYXRlRGVjb2RlCi9MZW5ndGggNTIKPj4Kc3RyZWFtCnicU1BwCuFSAAJ9N0MF +QwuFkDQwzwAIQ1LATA2P1JycfIXw/KKcFE2FkCygoGsIACsbDAQKZW5kc3RyZWFtIAplbmRvYmog +eHJlZgowIDUKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDE1IDAwMDAwIG4gCjAwMDAwMDAw +NjYgMDAwMDAgbiAKMDAwMDAwMDE0OSAwMDAwMCBuIAowMDAwMDAwMzMxIDAwMDAwIG4gCnRyYWls +ZXIKCjw8Ci9Sb290IDEgMCBSCi9TaXplIDUKPj4Kc3RhcnR4cmVmCjQ1NgolJUVPRgo= + +------=_Part_16_9312243.1473680273820 +Content-Type: application/octet-stream; name="Attachment3.pdf" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment + +JVBERi0xLjEKJeLjz9MKMSAwIG9iaiAKPDwKL1R5cGUgL0NhdGFsb2cKL1BhZ2VzIDIgMCBSCj4+ +CmVuZG9iaiAKMiAwIG9iaiAKPDwKL0tpZHMgWzMgMCBSXQovVHlwZSAvUGFnZXMKL01lZGlhQm94 +IFswIDAgMzAwIDE0NF0KL0NvdW50IDEKPj4KZW5kb2JqIAozIDAgb2JqIAo8PAovUmVzb3VyY2Vz +IAo8PAovRm9udCAKPDwKL0YxIAo8PAovU3VidHlwZSAvVHlwZTEKL1R5cGUgL0ZvbnQKL0Jhc2VG +b250IC9UaW1lcy1Sb21hbgo+Pgo+Pgo+PgovQ29udGVudHMgNCAwIFIKL1BhcmVudCAyIDAgUgov +VHlwZSAvUGFnZQovTWVkaWFCb3ggWzAgMCAzMDAgMTQ0XQo+PgplbmRvYmogCjQgMCBvYmogCjw8 +Ci9GaWx0ZXIgL0ZsYXRlRGVjb2RlCi9MZW5ndGggNTIKPj4Kc3RyZWFtCnicU1BwCuFSAAJ9N0MF +QwuFkDQwzwAIQ1LATA2P1JycfIXw/KKcFE2FkCygoGsIACsbDAQKZW5kc3RyZWFtIAplbmRvYmog +eHJlZgowIDUKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDE1IDAwMDAwIG4gCjAwMDAwMDAw +NjYgMDAwMDAgbiAKMDAwMDAwMDE0OSAwMDAwMCBuIAowMDAwMDAwMzMxIDAwMDAwIG4gCnRyYWls +ZXIKCjw8Ci9Sb290IDEgMCBSCi9TaXplIDUKPj4Kc3RhcnR4cmVmCjQ1NgolJUVPRgo= + +------=_Part_16_9312243.1473680273820-- + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/templateparser/autotests/data/html-attachment1.mbox.plain.reply new/messagelib-16.08.3/templateparser/autotests/data/html-attachment1.mbox.plain.reply --- old/messagelib-16.08.2/templateparser/autotests/data/html-attachment1.mbox.plain.reply 1970-01-01 01:00:00.000000000 +0100 +++ new/messagelib-16.08.3/templateparser/autotests/data/html-attachment1.mbox.plain.reply 2016-11-04 13:20:36.000000000 +0100 @@ -0,0 +1 @@ +A Body Text \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/templateparser/autotests/data/html-attachment2.mbox new/messagelib-16.08.3/templateparser/autotests/data/html-attachment2.mbox --- old/messagelib-16.08.2/templateparser/autotests/data/html-attachment2.mbox 1970-01-01 01:00:00.000000000 +0100 +++ new/messagelib-16.08.3/templateparser/autotests/data/html-attachment2.mbox 2016-11-04 13:20:36.000000000 +0100 @@ -0,0 +1,30 @@ +From maillists@whattf.com Tue Jul 05 19:20:58 2011 +Return-path: <maillists@whattf.com> +Envelope-to: maillists@whattf.com +Date: Mon, 24 Oct 2016 11:53:00 +0100 +To: maillists@whattf.com +From: maillists@whattf.com +MIME-Version: 1.0 +Subject: Test +Content-Type: multipart/related; boundary="----=_Part_20324_1054669183.1477306380301" +MIME-Version: 1.0 + +------=_Part_20324_1054669183.1477306380301 +Content-Type: text/html; charset="UTF-8" +Content-Transfer-Encoding: 7bit + +<html><head></head><body>HTML Text</body></html> +------=_Part_20324_1054669183.1477306380301 +Content-Type: image/png +Content-Disposition: attachment; filename="image1.png" +Content-ID: cid1 + +Image1 +------=_Part_20324_1054669183.1477306380301 +Content-Type: image/png +Content-Disposition: attachment; filename="image2.png" +Content-ID: cid2 + +Image2 +------=_Part_20324_1054669183.1477306380301-- + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/templateparser/autotests/data/html-attachment2.mbox.plain.reply new/messagelib-16.08.3/templateparser/autotests/data/html-attachment2.mbox.plain.reply --- old/messagelib-16.08.2/templateparser/autotests/data/html-attachment2.mbox.plain.reply 1970-01-01 01:00:00.000000000 +0100 +++ new/messagelib-16.08.3/templateparser/autotests/data/html-attachment2.mbox.plain.reply 2016-11-04 13:20:36.000000000 +0100 @@ -0,0 +1 @@ +HTML Text \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/templateparser/autotests/data/plain-message.mbox.plain.reply new/messagelib-16.08.3/templateparser/autotests/data/plain-message.mbox.plain.reply --- old/messagelib-16.08.2/templateparser/autotests/data/plain-message.mbox.plain.reply 1970-01-01 01:00:00.000000000 +0100 +++ new/messagelib-16.08.3/templateparser/autotests/data/plain-message.mbox.plain.reply 2016-11-04 13:20:36.000000000 +0100 @@ -0,0 +1,5 @@ +This is the message text from Sudhendu Kumar<dontspamme@yoohoo.com>. + +-- +Thanks & Regards +Sudhendu Kumar diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/templateparser/autotests/templateparsertest.cpp new/messagelib-16.08.3/templateparser/autotests/templateparsertest.cpp --- old/messagelib-16.08.2/templateparser/autotests/templateparsertest.cpp 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/templateparser/autotests/templateparsertest.cpp 2016-11-04 13:20:36.000000000 +0100 @@ -78,6 +78,58 @@ QCOMPARE(convertedHtmlContent, referenceData); } +void TemplateParserTester::test_replyPlain_data() +{ + QTest::addColumn<QString>("mailFileName"); + QTest::addColumn<QString>("referenceFileName"); + + QDir dir(QStringLiteral(MAIL_DATA_DIR)); + foreach (const QString &file, dir.entryList(QStringList(QLatin1String("*.mbox")), QDir::Files | QDir::Readable | QDir::NoSymLinks)) { + const auto expectedFile = dir.path() + QLatin1Char('/') + file + QStringLiteral(".plain.reply"); + if (!QFile::exists(expectedFile)) { + continue; + } + QTest::newRow(file.toLatin1().constData()) << QString(dir.path() + QLatin1Char('/') + file) << expectedFile; + } +} + +void TemplateParserTester::test_replyPlain() +{ + QFETCH(QString, mailFileName); + QFETCH(QString, referenceFileName); + + // load input mail + QFile mailFile(mailFileName); + QVERIFY(mailFile.open(QIODevice::ReadOnly)); + const QByteArray mailData = KMime::CRLFtoLF(mailFile.readAll()); + QVERIFY(!mailData.isEmpty()); + KMime::Message::Ptr msg(new KMime::Message); + msg->setContent(mailData); + msg->parse(); + + // load expected result + QFile referenceFile(referenceFileName); + QVERIFY(referenceFile.open(QIODevice::ReadOnly)); + const QByteArray referenceRawData = KMime::CRLFtoLF(referenceFile.readAll()); + const QString referenceData = QString::fromLatin1(referenceRawData); +// QVERIFY(!referenceData.isEmpty()); + +// QCOMPARE(msg->subject()->as7BitString(false).constData(), "Plain Message Test"); + // QCOMPARE(msg->contents().size(), 0); + + TemplateParser::TemplateParser parser(msg, TemplateParser::TemplateParser::Reply); + parser.mOtp->parseObjectTree(msg.data()); + parser.mOrigMsg = msg; +// QVERIFY(parser.mOtp->htmlContent().isEmpty()); +// QVERIFY(!parser.mOtp->plainTextContent().isEmpty()); + + const QString convertedHtmlContent = parser.plainMessageText(false, TemplateParser::TemplateParser::NoSelectionAllowed); + + QCOMPARE(convertedHtmlContent, referenceData); +} + + + void TemplateParserTester::test_processWithTemplatesForBody_data() { QTest::addColumn<QString>("command"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/templateparser/autotests/templateparsertest.h new/messagelib-16.08.3/templateparser/autotests/templateparsertest.h --- old/messagelib-16.08.2/templateparser/autotests/templateparsertest.h 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/templateparser/autotests/templateparsertest.h 2016-11-04 13:20:36.000000000 +0100 @@ -33,6 +33,9 @@ void test_convertedHtml(); void test_convertedHtml_data(); + void test_replyPlain(); + void test_replyPlain_data(); + /** * Tests whether templates are returning required body or not */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/webengineviewer/src/CMakeLists.txt new/messagelib-16.08.3/webengineviewer/src/CMakeLists.txt --- old/messagelib-16.08.2/webengineviewer/src/CMakeLists.txt 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/webengineviewer/src/CMakeLists.txt 2016-11-04 13:20:36.000000000 +0100 @@ -48,9 +48,9 @@ webenginescript.cpp webengineview.cpp webenginemanagescript.cpp - webengineprintmessagebox.cpp webengineexporthtmlpagejob.cpp + webenginenavigationrequestinterceptor.cpp ) set(libwebengineviewer_interceptor_SRCS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/webengineviewer/src/tests/testwebengine.cpp new/messagelib-16.08.3/webengineviewer/src/tests/testwebengine.cpp --- old/messagelib-16.08.2/webengineviewer/src/tests/testwebengine.cpp 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/webengineviewer/src/tests/testwebengine.cpp 2016-11-04 13:20:36.000000000 +0100 @@ -36,8 +36,6 @@ hboxLayout->addWidget(pageView); mEnginePage = new WebEngineViewer::WebEnginePage(this); pageView->setPage(mEnginePage); - pageView->setContextMenuPolicy(Qt::DefaultContextMenu); - setContextMenuPolicy(Qt::DefaultContextMenu); pageView->load(QUrl(QStringLiteral("http://www.kde.org"))); } @@ -49,7 +47,6 @@ TestWebEngineView::TestWebEngineView(QWidget *parent) : QWebEngineView(parent) { - setContextMenuPolicy(Qt::DefaultContextMenu); settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, false); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/webengineviewer/src/webenginenavigationrequestinterceptor.cpp new/messagelib-16.08.3/webengineviewer/src/webenginenavigationrequestinterceptor.cpp --- old/messagelib-16.08.2/webengineviewer/src/webenginenavigationrequestinterceptor.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/messagelib-16.08.3/webengineviewer/src/webenginenavigationrequestinterceptor.cpp 2016-11-04 13:20:36.000000000 +0100 @@ -0,0 +1,47 @@ +/* + Copyright (C) 2016 Laurent Montel <montel@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#include "webenginenavigationrequestinterceptor.h" +#include "webenginepage.h" +using namespace WebEngineViewer; + +WebEngineNavigationRequestInterceptor::WebEngineNavigationRequestInterceptor(QWebEnginePage *page) + : QWebEnginePage(page), + mTargetPage(page) +{ + +} + +WebEngineNavigationRequestInterceptor::~WebEngineNavigationRequestInterceptor() +{ + +} + +bool WebEngineNavigationRequestInterceptor::acceptNavigationRequest(const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame) +{ + Q_UNUSED(isMainFrame); + WebEnginePage *page = qobject_cast<WebEnginePage *>(mTargetPage); + if (type == NavigationTypeLinkClicked && page) { + Q_EMIT page->urlClicked(url); + return false; + } + return false; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/webengineviewer/src/webenginenavigationrequestinterceptor.h new/messagelib-16.08.3/webengineviewer/src/webenginenavigationrequestinterceptor.h --- old/messagelib-16.08.2/webengineviewer/src/webenginenavigationrequestinterceptor.h 1970-01-01 01:00:00.000000000 +0100 +++ new/messagelib-16.08.3/webengineviewer/src/webenginenavigationrequestinterceptor.h 2016-11-04 13:20:36.000000000 +0100 @@ -0,0 +1,43 @@ +/* + Copyright (C) 2016 Laurent Montel <montel@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef WEBENGINENAVIGATIONREQUESTINTERCEPTOR_H +#define WEBENGINENAVIGATIONREQUESTINTERCEPTOR_H + +#include <QWebEnginePage> + +namespace WebEngineViewer +{ +class WebEnginePage; +class WebEngineNavigationRequestInterceptor : public QWebEnginePage +{ + Q_OBJECT +public: + explicit WebEngineNavigationRequestInterceptor(QWebEnginePage *page); + ~WebEngineNavigationRequestInterceptor(); + +protected: + bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame) Q_DECL_OVERRIDE; + +private: + QWebEnginePage *mTargetPage; +}; +} + +#endif // WEBENGINENAVIGATIONREQUESTINTERCEPTOR_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/messagelib-16.08.2/webengineviewer/src/webengineview.cpp new/messagelib-16.08.3/webengineviewer/src/webengineview.cpp --- old/messagelib-16.08.2/webengineviewer/src/webengineview.cpp 2016-10-06 09:00:37.000000000 +0200 +++ new/messagelib-16.08.3/webengineviewer/src/webengineview.cpp 2016-11-04 13:20:36.000000000 +0100 @@ -18,6 +18,7 @@ */ #include "webengineview.h" +#include "webenginenavigationrequestinterceptor.h" #include "webenginemanagescript.h" #include "webengineviewer_debug.h" #include "../config-webengineviewer.h" @@ -37,13 +38,26 @@ public: WebEngineViewPrivate() : mSavedRelativePosition(-1), - mCurrentWidget(Q_NULLPTR) + mCurrentWidget(Q_NULLPTR), + mWebEngineNavigatorInterceptor(Q_NULLPTR), + mWebEngineNavigatorInterceptorView(Q_NULLPTR) + { } + ~WebEngineViewPrivate() + { + delete mWebEngineNavigatorInterceptor; + mWebEngineNavigatorInterceptor = Q_NULLPTR; + delete mWebEngineNavigatorInterceptorView; + mWebEngineNavigatorInterceptorView = Q_NULLPTR; + } + qreal mSavedRelativePosition; QWidget *mCurrentWidget; WebEngineManageScript *mManagerScript; + WebEngineNavigationRequestInterceptor *mWebEngineNavigatorInterceptor; + WebEngineView *mWebEngineNavigatorInterceptorView; }; WebEngineView::WebEngineView(QWidget *parent) @@ -193,7 +207,13 @@ QWebEngineView *WebEngineView::createWindow(QWebEnginePage::WebWindowType type) { Q_UNUSED(type); - return Q_NULLPTR; + delete d->mWebEngineNavigatorInterceptor; + delete d->mWebEngineNavigatorInterceptorView; + d->mWebEngineNavigatorInterceptorView = new WebEngineView(); + + d->mWebEngineNavigatorInterceptor = new WebEngineNavigationRequestInterceptor(this->page()); + d->mWebEngineNavigatorInterceptorView->setPage(d->mWebEngineNavigatorInterceptor); + return d->mWebEngineNavigatorInterceptorView; } void WebEngineView::clearRelativePosition()