Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit c6592b91 authored by Laurent Montel's avatar Laurent Montel 😁

Port some Q_FOREACH to for(...:...)

parent 0936c01c
......@@ -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).")
......
......@@ -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(',')) << ")";
......
......@@ -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) {
......
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