Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
PIM Messagelib
Commits
f43ebfec
Commit
f43ebfec
authored
Jul 12, 2021
by
Laurent Montel
😁
Browse files
Port some foreach
parent
53ee55c8
Pipeline
#70020
passed with stage
in 40 minutes and 27 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
messagecomposer/autotests/skeletonmessagejobtest.cpp
View file @
f43ebfec
...
...
@@ -156,7 +156,8 @@ void SkeletonMessageJobTest::testAddresses()
{
QVERIFY
(
message
->
to
(
false
));
// qDebug() << "To:" << message->to()->asUnicodeString();
foreach
(
const
auto
&
addr
,
message
->
to
()
->
mailboxes
())
{
const
auto
mailboxes
{
message
->
to
()
->
mailboxes
()};
for
(
const
auto
&
addr
:
mailboxes
)
{
// qDebug() << addr.prettyAddress();
QVERIFY
(
to
.
contains
(
addr
.
prettyAddress
()));
to
.
removeOne
(
addr
.
prettyAddress
());
...
...
@@ -167,7 +168,8 @@ void SkeletonMessageJobTest::testAddresses()
{
QVERIFY
(
message
->
cc
(
false
));
// qDebug() << "Cc:" << message->cc()->asUnicodeString();
foreach
(
const
auto
&
addr
,
message
->
cc
()
->
mailboxes
())
{
const
auto
mailboxes
{
message
->
cc
()
->
mailboxes
()};
for
(
const
auto
&
addr
:
mailboxes
)
{
// qDebug() << addr.prettyAddress();
QVERIFY
(
cc
.
contains
(
addr
.
prettyAddress
()));
cc
.
removeOne
(
addr
.
prettyAddress
());
...
...
@@ -178,7 +180,8 @@ void SkeletonMessageJobTest::testAddresses()
{
QVERIFY
(
message
->
bcc
(
false
));
// qDebug() << "Bcc:" << message->bcc()->asUnicodeString();
foreach
(
const
auto
&
addr
,
message
->
bcc
()
->
mailboxes
())
{
const
auto
mailboxes
{
message
->
bcc
()
->
mailboxes
()};
for
(
const
auto
&
addr
:
mailboxes
)
{
// qDebug() << addr.prettyAddress();
QVERIFY
(
bcc
.
contains
(
addr
.
prettyAddress
()));
bcc
.
removeOne
(
addr
.
prettyAddress
());
...
...
messagecomposer/src/composer/composerviewbase.cpp
View file @
f43ebfec
...
...
@@ -112,7 +112,8 @@ bool ComposerViewBase::isComposing() const
void
ComposerViewBase
::
setMessage
(
const
KMime
::
Message
::
Ptr
&
msg
,
bool
allowDecryption
)
{
if
(
m_attachmentModel
)
{
foreach
(
const
MessageCore
::
AttachmentPart
::
Ptr
&
attachment
,
m_attachmentModel
->
attachments
())
{
const
auto
attachments
{
m_attachmentModel
->
attachments
()};
for
(
const
MessageCore
::
AttachmentPart
::
Ptr
&
attachment
:
attachments
)
{
if
(
!
m_attachmentModel
->
removeAttachment
(
attachment
))
{
qCWarning
(
MESSAGECOMPOSER_LOG
)
<<
"Attachment not found."
;
}
...
...
@@ -174,10 +175,12 @@ void ComposerViewBase::setMessage(const KMime::Message::Ptr &msg, bool allowDecr
otp
.
parseObjectTree
(
msgContent
);
// Load the attachments
foreach
(
const
auto
&
att
,
otp
.
nodeHelper
()
->
attachmentsOfExtraContents
())
{
const
auto
attachmentsOfExtraContents
{
otp
.
nodeHelper
()
->
attachmentsOfExtraContents
()};
for
(
const
auto
&
att
:
attachmentsOfExtraContents
)
{
addAttachmentPart
(
att
);
}
foreach
(
const
auto
&
att
,
msgContent
->
attachments
())
{
const
auto
attachments
{
msgContent
->
attachments
()};
for
(
const
auto
&
att
:
attachments
)
{
addAttachmentPart
(
att
);
}
...
...
messagecomposer/src/recipient/recipientseditor.h
View file @
f43ebfec
...
...
@@ -63,7 +63,7 @@ public:
@param recipient The recipient(s) you want to add.
@param type The recipient type.
*/
Q_REQUIRED_RESULT
bool
addRecipient
(
const
QString
&
recipient
,
Recipient
::
Type
type
);
bool
addRecipient
(
const
QString
&
recipient
,
Recipient
::
Type
type
);
/** Removes the recipient provided it can be found and has the given type.
@param recipient The recipient(s) you want to remove.
...
...
messagelist/src/core/messageitem.cpp
View file @
f43ebfec
...
...
@@ -303,7 +303,8 @@ QString MessageItem::tagListDescription() const
{
QString
ret
;
foreach
(
const
Tag
*
tag
,
tagList
())
{
const
auto
tags
{
tagList
()};
for
(
const
Tag
*
tag
:
tags
)
{
if
(
!
ret
.
isEmpty
())
{
ret
+=
QLatin1String
(
", "
);
}
...
...
messagelist/src/widget.cpp
View file @
f43ebfec
...
...
@@ -225,7 +225,8 @@ void MessageList::Widget::slotTagsFetched(KJob *job)
QString
());
QStringList
tagFound
;
foreach
(
const
Akonadi
::
Tag
&
akonadiTag
,
fetchJob
->
tags
())
{
const
auto
tags
{
fetchJob
->
tags
()};
for
(
const
Akonadi
::
Tag
&
akonadiTag
:
tags
)
{
if
(
tagSelectedLst
.
contains
(
akonadiTag
.
url
().
url
()))
{
tagFound
.
append
(
akonadiTag
.
url
().
url
());
QString
iconName
=
QStringLiteral
(
"mail-tagged"
);
...
...
mimetreeparser/src/nodehelper.cpp
View file @
f43ebfec
...
...
@@ -898,7 +898,8 @@ void NodeHelper::mergeExtraNodes(KMime::Content *node)
node
->
addContent
(
c
);
}
Q_FOREACH
(
KMime
::
Content
*
child
,
node
->
contents
())
{
const
auto
contents
{
node
->
contents
()};
for
(
KMime
::
Content
*
child
:
contents
)
{
mergeExtraNodes
(
child
);
}
}
...
...
@@ -918,7 +919,8 @@ void NodeHelper::cleanFromExtraNodes(KMime::Content *node)
}
}
}
Q_FOREACH
(
KMime
::
Content
*
child
,
node
->
contents
())
{
const
auto
contents
{
node
->
contents
()};
for
(
KMime
::
Content
*
child
:
contents
)
{
cleanFromExtraNodes
(
child
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment