Commit 6bbe6c72 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port some foreach code

parent 6d060814
......@@ -268,7 +268,8 @@ QString renderTreeHelper(const MimeTreeParser::MessagePart::Ptr &messagePart, QS
QString ret = line;
indent += QLatin1Char(' ');
foreach (const auto &subPart, messagePart->subParts()) {
const auto subParts = messagePart->subParts();
for (const auto &subPart : subParts) {
ret += renderTreeHelper(subPart, indent);
}
return ret;
......
......@@ -49,7 +49,8 @@ QString stringifyMessagePartTree(const MimeTreeParser::MessagePart::Ptr &message
QString ret = line;
indent += QLatin1Char(' ');
foreach (const auto &subPart, messagePart->subParts()) {
const auto subParts = messagePart->subParts();
for (const auto &subPart : subParts) {
ret += stringifyMessagePartTree(subPart, indent);
}
return ret;
......
......@@ -55,7 +55,7 @@ void TemplateParserJobTest::test_convertedHtml_data()
QDir dir(QStringLiteral(MAIL_DATA_DIR));
const auto l = dir.entryList(QStringList(QStringLiteral("plain*.mbox")), QDir::Files | QDir::Readable | QDir::NoSymLinks);
foreach (const QString &file, l) {
for (const QString &file : l) {
QTest::newRow(file.toLatin1().constData()) << QString(dir.path() + QLatin1Char('/') + file) << QString(dir.path() + QLatin1Char('/') + file + QLatin1String(".html"));
}
}
......@@ -109,7 +109,7 @@ void TemplateParserJobTest::test_replyHtml_data()
QDir dir(QStringLiteral(MAIL_DATA_DIR));
const auto l = dir.entryList(QStringList(QStringLiteral("*.mbox")), QDir::Files | QDir::Readable | QDir::NoSymLinks);
foreach (const QString &file, l) {
for (const QString &file : l) {
const QString expectedFile = dir.path() + QLatin1Char('/') + file + QStringLiteral(".html.reply");
if (!QFile::exists(expectedFile)) {
continue;
......@@ -168,7 +168,7 @@ void TemplateParserJobTest::test_replyPlain_data()
QDir dir(QStringLiteral(MAIL_DATA_DIR));
const auto l = dir.entryList(QStringList(QStringLiteral("*.mbox")), QDir::Files | QDir::Readable | QDir::NoSymLinks);
foreach (const QString &file, l) {
for (const QString &file : l) {
const QString expectedFile = dir.path() + QLatin1Char('/') + file + QStringLiteral(".plain.reply");
if (!QFile::exists(expectedFile)) {
continue;
......@@ -218,7 +218,7 @@ void TemplateParserJobTest::test_forwardPlain_data()
QDir dir(QStringLiteral(MAIL_DATA_DIR));
const auto l = dir.entryList(QStringList(QStringLiteral("*.mbox")), QDir::Files | QDir::Readable | QDir::NoSymLinks);
foreach (const QString &file, l) {
for (const QString &file : l) {
const QString expectedFile = dir.path() + QLatin1Char('/') + file + QStringLiteral(".plain.reply");
if (!QFile::exists(expectedFile)) {
continue;
......@@ -268,7 +268,7 @@ void TemplateParserJobTest::test_forwardHtml_data()
QDir dir(QStringLiteral(MAIL_DATA_DIR));
const auto l = dir.entryList(QStringList(QStringLiteral("*.mbox")), QDir::Files | QDir::Readable | QDir::NoSymLinks);
foreach (const QString &file, l) {
for (const QString &file : l) {
const QString expectedFile = dir.path() + QLatin1Char('/') + file + QStringLiteral(".html.reply");
if (!QFile::exists(expectedFile)) {
continue;
......@@ -322,7 +322,7 @@ void TemplateParserJobTest::test_forwardedAttachments_data()
QDir dir(QStringLiteral(MAIL_DATA_DIR));
const auto l = dir.entryList(QStringList(QStringLiteral("*.mbox")), QDir::Files | QDir::Readable | QDir::NoSymLinks);
foreach (const QString &file, l) {
for (const QString &file : l) {
if (!QFile::exists(dir.path() + QLatin1Char('/') + file + QStringLiteral(".html.reply"))) {
continue;
}
......
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