summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-11-26 09:43:56 +0100
committerMontel Laurent <[email protected]>2017-11-26 09:43:56 +0100
commitc6592b914ff41cf17a1d026d64796a4b46b441df (patch)
tree8615c3af06575a6b35bde032637a39de4c07c61c
parent0936c01caf53294585109f1d0a410cb819800f3a (diff)
Port some Q_FOREACH to for(...:...)
-rw-r--r--resources/ews/ewsclient/ewsrecurrence.cpp4
-rw-r--r--resources/ews/ewsresource_debug.h6
-rw-r--r--resources/ews/mail/ewsmailhandler.cpp2
3 files changed, 6 insertions, 6 deletions
diff --git a/resources/ews/ewsclient/ewsrecurrence.cpp b/resources/ews/ewsclient/ewsrecurrence.cpp
index c988928..5bd311d 100644
--- a/resources/ews/ewsclient/ewsrecurrence.cpp
+++ b/resources/ews/ewsclient/ewsrecurrence.cpp
@@ -551,8 +551,8 @@ bool EwsRecurrence::readDow(QXmlStreamReader &reader, QBitArray &dow)
{
bool ok;
QString text = reader.readElementText();
- QStringList days = text.split(QLatin1Char(' '));
- Q_FOREACH (const QString &day, days) {
+ const QStringList days = text.split(QLatin1Char(' '));
+ for (const QString &day : days) {
short dowIndex = decodeEnumString<short>(day, dayOfWeekNames, dayOfWeekNameCount, &ok);
if (reader.error() != QXmlStreamReader::NoError || !ok) {
qCWarning(EWSCLI_LOG) << QStringLiteral("Failed to read EWS request - invalid %1 element (value: %2).")
diff --git a/resources/ews/ewsresource_debug.h b/resources/ews/ewsresource_debug.h
index 6df7477..66f2d0c 100644
--- a/resources/ews/ewsresource_debug.h
+++ b/resources/ews/ewsresource_debug.h
@@ -34,7 +34,7 @@ inline QDebug operator<<(QDebug debug, const Akonadi::Item::List &items)
QDebugStateSaver saver(debug);
QStringList itemStrs;
itemStrs.reserve(items.count());
- Q_FOREACH (const Akonadi::Item &item, items) {
+ for (const Akonadi::Item &item : items) {
itemStrs.append(ewsHash(item.remoteId()));
}
debug.nospace().noquote() << "Akonadi::Item::List(" << itemStrs.join(QChar::fromLatin1(',')) << ")";
@@ -53,7 +53,7 @@ inline QDebug operator<<(QDebug debug, const Akonadi::Collection::List &cols)
QDebugStateSaver saver(debug);
QStringList itemStrs;
itemStrs.reserve(cols.count());
- Q_FOREACH (const Akonadi::Collection &col, cols) {
+ for (const Akonadi::Collection &col : cols) {
itemStrs.append(EwsClient::folderHash.value(col.remoteId(), ewsHash(col.remoteId())));
}
debug.nospace().noquote() << "Akonadi::Collection::List(" << itemStrs.join(QChar::fromLatin1(',')) << ")";
@@ -72,7 +72,7 @@ inline QDebug operator<<(QDebug debug, const QSet<QByteArray> &items)
QDebugStateSaver saver(debug);
QStringList itemStrs;
itemStrs.reserve(items.count());
- Q_FOREACH (const QByteArray &item, items) {
+ for (const QByteArray &item : items) {
itemStrs.append(QString::fromLatin1(item));
}
debug.nospace().noquote() << "QSet<QByteArray>(" << itemStrs.join(QChar::fromLatin1(',')) << ")";
diff --git a/resources/ews/mail/ewsmailhandler.cpp b/resources/ews/mail/ewsmailhandler.cpp
index e7967b9..e00845b 100644
--- a/resources/ews/mail/ewsmailhandler.cpp
+++ b/resources/ews/mail/ewsmailhandler.cpp
@@ -112,7 +112,7 @@ QHash<EwsPropertyField, QVariant> EwsMailHandler::writeFlags(const QSet<QByteArr
bool isRead = false;
bool isFlagged = false;
- Q_FOREACH (const QByteArray &flag, flags) {
+ for (const QByteArray &flag : flags) {
if (flag == MessageFlags::Seen) {
isRead = true;
} else if (flag == MessageFlags::Flagged) {