Commit 3d96a7bc authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to QRegularExpression

parent 6bb9462e
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <QFile> #include <QFile>
#include <QProcess> #include <QProcess>
#include <QRegExp> #include <QRegularExpression>
#include <QStringList> #include <QStringList>
#include <QStandardPaths> #include <QStandardPaths>
#include <QTest> #include <QTest>
...@@ -43,11 +43,11 @@ void testHeaderFile(const QString &data, const QString &absolutePath, const QStr ...@@ -43,11 +43,11 @@ void testHeaderFile(const QString &data, const QString &absolutePath, const QStr
header += QStringLiteral("\n</body>\n</html>\n"); header += QStringLiteral("\n</body>\n</html>\n");
header.replace(QStringLiteral("file://") + absolutePath, QStringLiteral("file://PATHTOSTYLE")); header.replace(QStringLiteral("file://") + absolutePath, QStringLiteral("file://PATHTOSTYLE"));
header.replace(QRegExp(QStringLiteral("[\t ]+")), QStringLiteral(" ")); header.replace(QRegularExpression(QStringLiteral("[\t ]+")), QStringLiteral(" "));
header.replace(QRegExp(QStringLiteral("[\t ]*\n+[\t ]*")), QStringLiteral("\n")); header.replace(QRegularExpression(QStringLiteral("[\t ]*\n+[\t ]*")), QStringLiteral("\n"));
header.replace(QRegExp(QStringLiteral("([\n\t ])\\1+")), QStringLiteral("\\1")); header.replace(QRegularExpression(QStringLiteral("([\n\t ])\\1+")), QStringLiteral("\\1"));
header.replace(QRegExp(QStringLiteral(">\n+[\t ]*")), QStringLiteral(">")); header.replace(QRegularExpression(QStringLiteral(">\n+[\t ]*")), QStringLiteral(">"));
header.replace(QRegExp(QStringLiteral("[\t ]*\n+[\t ]*<")), QStringLiteral("<")); header.replace(QRegularExpression(QStringLiteral("[\t ]*\n+[\t ]*<")), QStringLiteral("<"));
header.replace(QLatin1String("&nbsp;"), QLatin1String("NBSP_ENTITY_PLACEHOLDER")); // xmlling chokes on &nbsp; header.replace(QLatin1String("&nbsp;"), QLatin1String("NBSP_ENTITY_PLACEHOLDER")); // xmlling chokes on &nbsp;
QString outName = name + QStringLiteral(".out.html"); QString outName = name + QStringLiteral(".out.html");
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include <QFile> #include <QFile>
#include <QProcess> #include <QProcess>
#include <QRegExp> #include <QRegularExpression>
#include <QStringList> #include <QStringList>
#include <QStandardPaths> #include <QStandardPaths>
#include <QTest> #include <QTest>
...@@ -44,11 +44,11 @@ void testHeaderFile(const HeaderStyle &style, KMime::Message *msg, const QString ...@@ -44,11 +44,11 @@ void testHeaderFile(const HeaderStyle &style, KMime::Message *msg, const QString
header += QStringLiteral("\n</body>\n</html>\n"); header += QStringLiteral("\n</body>\n</html>\n");
header.replace(QStringLiteral("file://") + style.theme().absolutePath(), QStringLiteral("file://PATHTOSTYLE")); header.replace(QStringLiteral("file://") + style.theme().absolutePath(), QStringLiteral("file://PATHTOSTYLE"));
header.replace(QRegExp(QStringLiteral("[\t ]+")), QStringLiteral(" ")); header.replace(QRegularExpression(QStringLiteral("[\t ]+")), QStringLiteral(" "));
header.replace(QRegExp(QStringLiteral("[\t ]*\n+[\t ]*")), QStringLiteral("\n")); header.replace(QRegularExpression(QStringLiteral("[\t ]*\n+[\t ]*")), QStringLiteral("\n"));
header.replace(QRegExp(QStringLiteral("([\n\t ])\\1+")), QStringLiteral("\\1")); header.replace(QRegularExpression(QStringLiteral("([\n\t ])\\1+")), QStringLiteral("\\1"));
header.replace(QRegExp(QStringLiteral(">\n+[\t ]*")), QStringLiteral(">")); header.replace(QRegularExpression(QStringLiteral(">\n+[\t ]*")), QStringLiteral(">"));
header.replace(QRegExp(QStringLiteral("[\t ]*\n+[\t ]*<")), QStringLiteral("<")); header.replace(QRegularExpression(QStringLiteral("[\t ]*\n+[\t ]*<")), QStringLiteral("<"));
header.replace(QLatin1String("&nbsp;"), QLatin1String("NBSP_ENTITY_PLACEHOLDER")); // xmlling chokes on &nbsp; header.replace(QLatin1String("&nbsp;"), QLatin1String("NBSP_ENTITY_PLACEHOLDER")); // xmlling chokes on &nbsp;
QString outName = name + QStringLiteral(".out.html"); QString outName = name + QStringLiteral(".out.html");
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <QFile> #include <QFile>
#include <QProcess> #include <QProcess>
#include <QTest> #include <QTest>
KMime::Message::Ptr MessageViewer::Test::readAndParseMail(const QString &mailFile) KMime::Message::Ptr MessageViewer::Test::readAndParseMail(const QString &mailFile)
{ {
QFile file(QStringLiteral(MAIL_DATA_DIR) + QLatin1Char('/') + mailFile); QFile file(QStringLiteral(MAIL_DATA_DIR) + QLatin1Char('/') + mailFile);
......
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