Commit 73da7f5e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to QRegularExpression

parent d5434493
......@@ -22,7 +22,7 @@
#include <QTest>
#include <QStandardPaths>
#include <QProcess>
#include <QRegularExpression>
#include <KMime/Message>
#include <MessageViewer/HeaderStyle>
......@@ -36,11 +36,11 @@ void testHeaderFile(const QString &data, const QString &name, const QString &dir
QString imagePath(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("libmessageviewer/pics"), QStandardPaths::LocateDirectory));
header.replace(QStringLiteral("file://") + imagePath, QStringLiteral("file://PATHTOIMAGES"));
header.replace(QRegExp(QStringLiteral("[\t ]+")), QStringLiteral(" "));
header.replace(QRegExp(QStringLiteral("[\t ]*\n+[\t ]*")), QStringLiteral("\n"));
header.replace(QRegExp(QStringLiteral("([\n\t ])\\1+")), QStringLiteral("\\1"));
header.replace(QRegExp(QStringLiteral(">\n+[\t ]*")), QStringLiteral(">"));
header.replace(QRegExp(QStringLiteral("[\t ]*\n+[\t ]*<")), QStringLiteral("<"));
header.replace(QRegularExpression(QStringLiteral("[\t ]+")), QStringLiteral(" "));
header.replace(QRegularExpression(QStringLiteral("[\t ]*\n+[\t ]*")), QStringLiteral("\n"));
header.replace(QRegularExpression(QStringLiteral("([\n\t ])\\1+")), QStringLiteral("\\1"));
header.replace(QRegularExpression(QStringLiteral(">\n+[\t ]*")), QStringLiteral(">"));
header.replace(QRegularExpression(QStringLiteral("[\t ]*\n+[\t ]*<")), QStringLiteral("<"));
header.replace(QLatin1String("&nbsp;"), QLatin1String("NBSP_ENTITY_PLACEHOLDER")); // xmlling chokes on &nbsp;
QString outName = name + QStringLiteral(".out.html");
......
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