replace foreach macro with standard for each loop (#5485)

This commit is contained in:
RickyRister 2025-01-16 21:18:15 -08:00 committed by GitHub
parent 0cbad25385
commit c148c8df7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 31 additions and 31 deletions

View file

@ -172,7 +172,7 @@ void QxtMailMessage::setExtraHeaders(const QHash<QString, QString> &a)
{
QHash<QString, QString> &headers = qxt_d->extraHeaders;
headers.clear();
foreach (const QString &key, a.keys()) {
for (const QString &key : a.keys()) {
headers[key.toLower()] = a[key];
}
}
@ -219,7 +219,7 @@ QByteArray qxt_fold_mime_header(const QString &key, const QString &value, const
line += prefix;
if (!value.contains("=?") && isASCII(value)) {
bool firstWord = true;
foreach (const QByteArray &word, value.toLatin1().split(' ')) {
for (const QByteArray &word : value.toLatin1().split(' ')) {
if (line.size() > 78) {
rv = rv + line + "\r\n";
line.clear();
@ -339,7 +339,7 @@ QByteArray QxtMailMessage::rfc2822() const
}
}
foreach (const QString &r, qxt_d->extraHeaders.keys()) {
for (const QString &r : qxt_d->extraHeaders.keys()) {
if ((r.toLower() == "content-type" || r.toLower() == "content-transfer-encoding") && attach.count()) {
// Since we're in multipart mode, we'll be outputting this later
continue;
@ -463,7 +463,7 @@ QByteArray QxtMailMessage::rfc2822() const
}
if (attach.count()) {
foreach (const QString &filename, attach.keys()) {
for (const QString &filename : attach.keys()) {
rv += "--" + qxt_d->boundary + "\r\n";
rv +=
qxt_fold_mime_header("Content-Disposition", QDir(filename).dirName(), "attachment; filename=");