Skip to content
GitLab
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
7d76d821
Commit
7d76d821
authored
Feb 01, 2021
by
Laurent Montel
Browse files
Port some more foreach
parent
e6118ac8
Changes
6
Hide whitespace changes
Inline
Side-by-side
messagecomposer/src/utils/util.cpp
View file @
7d76d821
...
...
@@ -337,7 +337,8 @@ KMime::Content *MessageComposer::Util::findTypeInMessage(KMime::Content *data, c
}
}
foreach
(
auto
child
,
data
->
contents
())
{
const
auto
contents
=
data
->
contents
();
for
(
auto
child
:
contents
)
{
if
((
!
child
->
contentType
()
->
isEmpty
())
&&
(
mimeType
==
child
->
contentType
()
->
mimeType
())
&&
(
subType
==
child
->
contentType
()
->
subType
()))
{
return
child
;
}
...
...
messagelist/src/core/model.cpp
View file @
7d76d821
...
...
@@ -3663,7 +3663,7 @@ void ModelPrivate::printStatistics()
int
totalThreads
=
0
;
if
(
!
mGroupHeaderItemHash
.
isEmpty
())
{
for
each
(
const
GroupHeaderItem
*
groupHeader
,
mGroupHeaderItemHash
)
{
for
(
const
GroupHeaderItem
*
groupHeader
:
qAsConst
(
mGroupHeaderItemHash
)
)
{
totalThreads
+=
groupHeader
->
childItemCount
();
}
}
else
{
...
...
messageviewer/src/viewer/viewer_p.cpp
View file @
7d76d821
...
...
@@ -1174,7 +1174,9 @@ void ViewerPrivate::setMessageItem(const Akonadi::Item &item, MimeTreeParser::Up
setHtmlLoadExtOverride
(
true
);
}
foreach
(
const
Akonadi
::
Item
::
Id
monitoredId
,
mMonitor
.
itemsMonitoredEx
())
{
const
auto
itemsMonitoredEx
=
mMonitor
.
itemsMonitoredEx
();
for
(
const
Akonadi
::
Item
::
Id
monitoredId
:
itemsMonitoredEx
)
{
mMonitor
.
setItemMonitored
(
Akonadi
::
Item
(
monitoredId
),
false
);
}
Q_ASSERT
(
mMonitor
.
itemsMonitoredEx
().
isEmpty
());
...
...
mimetreeparser/src/bodyformatter/utils.cpp
View file @
7d76d821
...
...
@@ -28,7 +28,8 @@ KMime::Content *MimeTreeParser::findTypeInDirectChilds(KMime::Content *content,
return
content
;
}
foreach
(
const
auto
child
,
content
->
contents
())
{
const
auto
contents
=
content
->
contents
();
for
(
const
auto
child
:
contents
)
{
if
((
!
child
->
contentType
()
->
isEmpty
())
&&
(
mimeType
==
child
->
contentType
(
false
)
->
mimeType
()))
{
return
child
;
}
...
...
mimetreeparser/src/messagepart.cpp
View file @
7d76d821
...
...
@@ -195,7 +195,8 @@ void MessagePart::parseInternal(KMime::Content *node, bool onlyOneMimePart)
QString
MessagePart
::
renderInternalText
()
const
{
QString
text
;
foreach
(
const
auto
&
mp
,
subParts
())
{
const
auto
subPartsLst
=
subParts
();
for
(
const
auto
&
mp
:
subPartsLst
)
{
text
+=
mp
->
text
();
}
return
text
;
...
...
@@ -203,7 +204,8 @@ QString MessagePart::renderInternalText() const
void
MessagePart
::
fix
()
const
{
foreach
(
const
auto
&
mp
,
subParts
())
{
const
auto
subPartsLst
=
subParts
();
for
(
const
auto
&
mp
:
subPartsLst
)
{
const
auto
m
=
mp
.
dynamicCast
<
MessagePart
>
();
if
(
m
)
{
m
->
fix
();
...
...
mimetreeparser/src/nodehelper.cpp
View file @
7d76d821
...
...
@@ -1011,7 +1011,8 @@ bool NodeHelper::unencryptedMessage_helper(KMime::Content *node, QByteArray &res
resultingData
+=
curNode
->
head
()
+
'\n'
;
}
const
QByteArray
boundary
=
curNode
->
contentType
()
->
boundary
();
foreach
(
KMime
::
Content
*
child
,
curNode
->
contents
())
{
const
auto
contents
=
curNode
->
contents
();
for
(
KMime
::
Content
*
child
:
contents
)
{
resultingData
+=
"
\n
--"
+
boundary
+
'\n'
;
const
bool
changed
=
unencryptedMessage_helper
(
child
,
resultingData
,
true
,
recursionLevel
+
1
);
if
(
changed
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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