Commit 43fa568c authored by Laurent Montel's avatar Laurent Montel 😁

Use some for(...:...)

parent 71931ac3
...@@ -629,7 +629,7 @@ void SetupServer::slotSafetyChanged() ...@@ -629,7 +629,7 @@ void SetupServer::slotSafetyChanged()
m_ui->authenticationCombo->clear(); m_ui->authenticationCombo->clear();
addAuthenticationItem(m_ui->authenticationCombo, MailTransport::Transport::EnumAuthenticationType::CLEAR); addAuthenticationItem(m_ui->authenticationCombo, MailTransport::Transport::EnumAuthenticationType::CLEAR);
foreach (int prot, protocols) { for (int prot : qAsConst(protocols)) {
addAuthenticationItem(m_ui->authenticationCombo, (MailTransport::Transport::EnumAuthenticationType::type) prot); addAuthenticationItem(m_ui->authenticationCombo, (MailTransport::Transport::EnumAuthenticationType::type) prot);
} }
if (protocols.isEmpty()) { if (protocols.isEmpty()) {
......
...@@ -449,7 +449,7 @@ void AccountDialog::enablePopFeatures() ...@@ -449,7 +449,7 @@ void AccountDialog::enablePopFeatures()
} }
authCombo->clear(); authCombo->clear();
foreach (int prot, supportedAuths) { for (int prot : qAsConst(supportedAuths)) {
authCombo->addItem(Transport::authenticationTypeString(prot), prot); authCombo->addItem(Transport::authenticationTypeString(prot), prot);
} }
......
...@@ -149,18 +149,18 @@ void ImapQuotaAttribute::deserialize(const QByteArray &data) ...@@ -149,18 +149,18 @@ void ImapQuotaAttribute::deserialize(const QByteArray &data)
mRoots << root.trimmed().toUtf8(); mRoots << root.trimmed().toUtf8();
} }
QStringList allLimits = members[1].trimmed().split(QStringLiteral("%%%")); const QStringList allLimits = members[1].trimmed().split(QStringLiteral("%%%"));
foreach (const QString &limits, allLimits) { for (const QString &limits : qAsConst(allLimits)) {
QMap<QByteArray, qint64> limitsMap; QMap<QByteArray, qint64> limitsMap;
QStringList strLines = limits.split(QStringLiteral("%%")); const QStringList strLines = limits.split(QStringLiteral("%%"));
QList<QByteArray> lines; QList<QByteArray> lines;
lines.reserve(strLines.count()); lines.reserve(strLines.count());
foreach (const QString &strLine, strLines) { for (const QString &strLine : strLines) {
lines << strLine.trimmed().toUtf8(); lines << strLine.trimmed().toUtf8();
} }
foreach (const QByteArray &line, lines) { for (const QByteArray &line : qAsConst(lines)) {
QByteArray trimmed = line.trimmed(); QByteArray trimmed = line.trimmed();
int wsIndex = trimmed.indexOf('%'); int wsIndex = trimmed.indexOf('%');
const QByteArray key = trimmed.mid(0, wsIndex).trimmed(); const QByteArray key = trimmed.mid(0, wsIndex).trimmed();
...@@ -171,19 +171,19 @@ void ImapQuotaAttribute::deserialize(const QByteArray &data) ...@@ -171,19 +171,19 @@ void ImapQuotaAttribute::deserialize(const QByteArray &data)
mLimits << limitsMap; mLimits << limitsMap;
} }
QStringList allUsages = members[2].trimmed().split(QStringLiteral("%%%")); const QStringList allUsages = members[2].trimmed().split(QStringLiteral("%%%"));
mUsages.reserve(allUsages.count()); mUsages.reserve(allUsages.count());
foreach (const QString &usages, allUsages) { for (const QString &usages : qAsConst(allUsages)) {
QMap<QByteArray, qint64> usagesMap; QMap<QByteArray, qint64> usagesMap;
QStringList strLines = usages.split(QStringLiteral("%%")); const QStringList strLines = usages.split(QStringLiteral("%%"));
QList<QByteArray> lines; QList<QByteArray> lines;
lines.reserve(strLines.count()); lines.reserve(strLines.count());
foreach (const QString &strLine, strLines) { for (const QString &strLine : qAsConst(strLines)) {
lines << strLine.trimmed().toUtf8(); lines << strLine.trimmed().toUtf8();
} }
foreach (const QByteArray &line, lines) { for (const QByteArray &line : qAsConst(lines)) {
QByteArray trimmed = line.trimmed(); QByteArray trimmed = line.trimmed();
int wsIndex = trimmed.indexOf('%'); int wsIndex = trimmed.indexOf('%');
const QByteArray key = trimmed.mid(0, wsIndex).trimmed(); const QByteArray key = trimmed.mid(0, wsIndex).trimmed();
......
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