Commit 655d39a8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port some foreach

parent 2997b0cd
Pipeline #27519 passed with stage
in 8 minutes and 31 seconds
......@@ -74,7 +74,8 @@ Content *Message::mainBodyPart(const QByteArray &type)
if (type.isEmpty()) {
return c->contents().at(0);
}
foreach (Content *c1, c->contents()) {
const auto contents = c->contents();
for (Content *c1 : contents) {
if (c1->contentType()->mimeType() == type) {
return c1;
}
......
......@@ -638,7 +638,8 @@ bool hasAttachment(Content *content)
// Ok, content itself is not an attachment. now we deal with multiparts
auto ct = content->contentType(false);
if (ct && ct->isMultipart() && !ct->isSubtype("related")) {// && !ct->isSubtype("alternative")) {
Q_FOREACH (Content *child, content->contents()) {
const auto contents = content->contents();
for (Content *child : contents) {
if (hasAttachment(child)) {
return true;
}
......@@ -659,7 +660,8 @@ bool hasInvitation(Content *content)
// Ok, content itself is not an invitation. now we deal with multiparts
if (content->contentType()->isMultipart()) {
Q_FOREACH (Content *child, content->contents()) {
const auto contents = content->contents();
for (Content *child : contents) {
if (hasInvitation(child)) {
return true;
}
......
......@@ -370,7 +370,8 @@ int main(int argc, char *argv[])
<< (jt).displayName
<< endl;
int i = 0;
foreach (const auto &it, (jt).mailboxList) {
const auto mailboxList = (jt).mailboxList;
for (const auto &it : mailboxList) {
cout << "result[" << j << "].mailboxList[" << i << "].displayName:\n"
<< (it).name() << endl
<< "result[" << j << "].mailboxList[" << i << "].addrSpec.localPart:\n"
......
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