Commit 104fd330 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

continue to port for(...:...)

parent 5cc58208
......@@ -307,7 +307,7 @@ QByteArray Content::encodedBody()
}
//add all (encoded) contents separated by boundaries
foreach (Content *c, d->multipartContents) {
for (Content *c : qAsConst(d->multipartContents)) {
e += boundary + '\n';
e += c->encodedContent(false); // don't convert LFs here, we do that later!!!!!
}
......@@ -453,7 +453,7 @@ QVector<Content*> Content::attachments()
if (ct && ct->isMultipart() && !ct->isSubtype("related") && !ct->isSubtype("alternative")) {
const QVector<Content*> contentsList = contents();
result.reserve(contentsList.count());
Q_FOREACH (Content *child, contentsList) {
for (Content *child : contentsList) {
if (isAttachment(child))
result.push_back(child);
else
......@@ -1036,7 +1036,7 @@ bool ContentPrivate::parseMultipart(Content *q)
Q_ASSERT(multipartContents.isEmpty());
body.clear();
const auto parts = mpp.parts();
foreach (const QByteArray &part, parts) {
for (const QByteArray &part : parts) {
Content *c = new Content(q);
c->setContent(part);
c->setFrozen(frozen);
......
......@@ -328,7 +328,7 @@ QByteArray MailboxList::as7BitString(bool withHeaderType) const
if (withHeaderType) {
rv = typeIntro();
}
foreach (const Types::Mailbox &mbox, d->mailboxList) {
for (const Types::Mailbox &mbox : qAsConst(d->mailboxList)) {
rv += mbox.as7BitString(d->encCS);
rv += ", ";
}
......@@ -391,7 +391,7 @@ QStringList MailboxList::displayNames() const
Q_D(const MailboxList);
QStringList rv;
rv.reserve(d->mailboxList.count());
foreach (const Types::Mailbox &mbox, d->mailboxList) {
for (const Types::Mailbox &mbox : qAsConst(d->mailboxList)) {
if (mbox.hasName())
rv.append(mbox.name());
else
......@@ -522,7 +522,7 @@ QString AddressList::asUnicodeString() const
{
Q_D(const AddressList);
QStringList rv;
foreach (const Types::Address &addr, d->addressList) {
for (const Types::Address &addr : qAsConst(d->addressList)) {
rv.reserve(rv.size() + addr.mailboxList.size());
foreach (const Types::Mailbox &mbox, addr.mailboxList) {
rv.append(mbox.prettyAddress());
......
......@@ -326,7 +326,7 @@ int main(int argc, char *argv[])
<< "result.displayName:\n" << result.displayName
<< endl;
int i = 0;
foreach (const auto &it, result.mailboxList) {
for (const auto &it : qAsConst(result.mailboxList)) {
cout << "result.mailboxList[" << i << "].displayName:\n"
<< (it).name() << endl
<< "result.mailboxList[" << i << "].addrSpec.localPart:\n"
......@@ -365,7 +365,7 @@ int main(int argc, char *argv[])
cout << (ok ? "OK" : "BAD") << endl;
int j = 0;
foreach (auto jt, result) {
for (const auto &jt : qAsConst(result)) {
cout << "result[" << j << "].displayName:\n"
<< (jt).displayName
<< endl;
......
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