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
KDE PIM Runtime
Commits
c3b6331b
Commit
c3b6331b
authored
Feb 03, 2021
by
Laurent Montel
😁
Browse files
port some foreach
parent
0ecea2dc
Pipeline
#49570
failed with stage
in 20 minutes and 6 seconds
Changes
18
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
resources/dav/resource/settings.cpp
View file @
c3b6331b
...
...
@@ -353,7 +353,8 @@ QDateTime Settings::getSyncRangeStart() const
void
Settings
::
buildUrlsList
()
{
foreach
(
const
QString
&
serializedUrl
,
remoteUrls
())
{
const
auto
remoteUrlsLst
=
remoteUrls
();
for
(
const
QString
&
serializedUrl
:
remoteUrlsLst
)
{
auto
urlConfig
=
new
UrlConfiguration
(
serializedUrl
);
const
QString
key
=
urlConfig
->
mUrl
+
QLatin1Char
(
','
)
+
KDAV
::
ProtocolInfo
::
protocolName
(
KDAV
::
Protocol
(
urlConfig
->
mProtocol
));
const
QString
pass
=
loadPassword
(
key
,
urlConfig
->
mUser
);
...
...
@@ -536,7 +537,8 @@ void Settings::updateToV3()
{
QStringList
updatedUrls
;
foreach
(
const
QString
&
url
,
remoteUrls
())
{
const
auto
remoteUrlsLst
=
remoteUrls
();
for
(
const
QString
&
url
:
remoteUrlsLst
)
{
QStringList
splitUrl
=
url
.
split
(
QLatin1Char
(
'|'
));
if
(
splitUrl
.
size
()
==
3
)
{
...
...
resources/ews/ewsclient/ewseventrequestbase.cpp
View file @
c3b6331b
...
...
@@ -42,7 +42,8 @@ bool EwsEventRequestBase::parseNotificationsResponse(QXmlStreamReader &reader)
if
(
EWSCLI_REQUEST_LOG
().
isDebugEnabled
())
{
if
(
resp
.
isSuccess
())
{
int
numEv
=
0
;
Q_FOREACH
(
const
Notification
&
nfy
,
resp
.
notifications
())
{
const
auto
notifications
=
resp
.
notifications
();
for
(
const
Notification
&
nfy
:
notifications
)
{
numEv
+=
nfy
.
events
().
size
();
}
qCDebugNC
(
EWSCLI_REQUEST_LOG
)
...
...
resources/ews/ewsclient/ewsfoldershape.cpp
View file @
c3b6331b
...
...
@@ -31,7 +31,7 @@ void EwsFolderShape::writeProperties(QXmlStreamWriter &writer) const
if
(
!
mProps
.
isEmpty
())
{
writer
.
writeStartElement
(
ewsTypeNsUri
,
QStringLiteral
(
"AdditionalProperties"
));
for
each
(
const
EwsPropertyField
&
prop
,
mProps
)
{
for
(
const
EwsPropertyField
&
prop
:
qAsConst
(
mProps
)
)
{
prop
.
write
(
writer
);
}
...
...
resources/ews/ewssubscriptionwidget.cpp
View file @
c3b6331b
...
...
@@ -225,7 +225,7 @@ void EwsSubscriptionWidgetPrivate::populateFolderTree()
mFolderTreeModel
->
clear
();
mFolderItemHash
.
clear
();
Q_FOREACH
(
const
EwsFolder
&
folder
,
mFolders
)
{
for
(
const
EwsFolder
&
folder
:
qAsConst
(
mFolders
)
)
{
QStandardItem
*
item
=
new
QStandardItem
(
folder
[
EwsFolderFieldDisplayName
].
toString
());
item
->
setFlags
(
Qt
::
ItemIsSelectable
|
Qt
::
ItemIsEnabled
);
item
->
setCheckable
(
true
);
...
...
resources/ews/mail/ewscreatemailjob.cpp
View file @
c3b6331b
...
...
@@ -56,7 +56,8 @@ void EwsCreateMailJob::doStart()
msg
->
changeEncoding
(
KMime
::
Headers
::
CEbase64
);
msg
->
contentTransferEncoding
(
true
)
->
setEncoding
(
KMime
::
Headers
::
CEbase64
);
}
else
{
Q_FOREACH
(
KMime
::
Content
*
content
,
msg
->
contents
())
{
const
auto
contents
=
msg
->
contents
();
for
(
KMime
::
Content
*
content
:
contents
)
{
content
->
changeEncoding
(
KMime
::
Headers
::
CEbase64
);
content
->
contentTransferEncoding
(
true
)
->
setEncoding
(
KMime
::
Headers
::
CEbase64
);
}
...
...
resources/ews/mail/ewsfetchmaildetailjob.cpp
View file @
c3b6331b
...
...
@@ -35,10 +35,12 @@ EwsFetchMailDetailJob::EwsFetchMailDetailJob(EwsClient &client, QObject *parent,
shape
<<
EwsPropertyField
(
QStringLiteral
(
"message:ReplyTo"
));
shape
<<
EwsPropertyField
(
QStringLiteral
(
"message:InternetMessageId"
));
shape
<<
EwsPropertyField
(
QStringLiteral
(
"item:Size"
));
Q_FOREACH
(
const
EwsPropertyField
&
field
,
EwsMailHandler
::
flagsProperties
())
{
const
auto
flagsProperties
=
EwsMailHandler
::
flagsProperties
();
for
(
const
EwsPropertyField
&
field
:
flagsProperties
)
{
shape
<<
field
;
}
Q_FOREACH
(
const
EwsPropertyField
&
field
,
EwsItemHandler
::
tagsProperties
())
{
const
auto
tagsProperties
=
EwsItemHandler
::
tagsProperties
();
for
(
const
EwsPropertyField
&
field
:
tagsProperties
)
{
shape
<<
field
;
}
mRequest
->
setItemShape
(
shape
);
...
...
resources/ews/tags/ewstagstore.cpp
View file @
c3b6331b
...
...
@@ -90,7 +90,7 @@ bool EwsTagStore::unserializeTag(const QByteArray &data, Akonadi::Tag &tag) cons
tag
.
setName
(
name
);
tag
.
setGid
(
gid
);
Q_FOREACH
(
Attribute
*
attr
,
attributes
)
{
for
(
Attribute
*
attr
:
qAsConst
(
attributes
)
)
{
tag
.
addAttribute
(
attr
);
}
...
...
resources/ews/tags/ewsupdateitemstagsjob.cpp
View file @
c3b6331b
...
...
@@ -44,7 +44,7 @@ void EwsUpdateItemsTagsJob::start()
* as the uid. If the EWS resource hasn't seen these tags yet it is necessary to fetch them
* first before any further processing.
*/
Q_FOREACH
(
const
Item
&
item
,
mItems
)
{
for
(
const
Item
&
item
:
qAsConst
(
mItems
)
)
{
Q_FOREACH
(
const
Tag
&
tag
,
item
.
tags
())
{
if
(
!
mTagStore
->
containsId
(
tag
.
id
()))
{
unknownTags
.
append
(
tag
);
...
...
resources/kalarm/kalarmdir/kalarmdirresource.cpp
View file @
c3b6331b
...
...
@@ -769,7 +769,7 @@ void KAlarmDirResource::retrieveItems(const Akonadi::Collection &collection)
// Retrieve events
Item
::
List
items
;
for
each
(
const
EventFile
&
data
,
mEvents
)
{
for
(
const
EventFile
&
data
:
qAsConst
(
mEvents
)
)
{
const
KAEvent
&
event
=
data
.
event
;
const
QString
mime
=
CalEvent
::
mimeType
(
event
.
category
());
if
(
mime
.
isEmpty
())
{
...
...
@@ -820,7 +820,7 @@ void KAlarmDirResource::fileCreated(const QString &path)
// The directory has been created. Load all files in it, and
// tell the Akonadi server to create an Item for each event.
loadFiles
(
true
);
for
each
(
const
EventFile
&
data
,
mEvents
)
{
for
(
const
EventFile
&
data
:
qAsConst
(
mEvents
)
)
{
createItem
(
data
.
event
);
}
}
else
{
...
...
@@ -832,7 +832,7 @@ void KAlarmDirResource::fileCreated(const QString &path)
if
(
createItemAndIndex
(
path
,
file
))
{
setCompatibility
();
}
DEBUG_DATA
(
"fileCreated:"
)
;
DEBUG_DATA
(
"fileCreated:"
)
}
}
}
...
...
resources/kolab/pimkolab/conversion/kcalconversion.cpp
View file @
c3b6331b
...
...
@@ -239,8 +239,8 @@ Kolab::Role fromRole(KCalendarCore::Attendee::Role r)
template
<
typename
T
>
QString
getCustomProperty
(
const
QString
&
id
,
const
T
&
e
)
{
std
::
vector
<
Kolab
::
CustomProperty
>
&
props
=
e
.
customProperties
();
for
each
(
const
Kolab
::
CustomProperty
&
p
,
props
)
{
const
std
::
vector
<
Kolab
::
CustomProperty
>
&
props
=
e
.
customProperties
();
for
(
const
Kolab
::
CustomProperty
&
p
:
props
)
{
if
(
fromStdString
(
p
.
identifier
)
==
id
)
{
return
fromStdString
(
p
.
value
);
}
...
...
@@ -682,7 +682,8 @@ template<typename T, typename I> void getRecurrence(T &i, const I &e)
foreach
(
const
QDateTime
&
dt
,
rec
->
exDateTimes
())
{
exdates
.
push_back
(
fromDate
(
dt
,
e
.
allDay
()));
}
foreach
(
const
QDate
&
dt
,
rec
->
exDates
())
{
const
auto
exDates
=
rec
->
exDates
();
for
(
const
QDate
&
dt
:
exDates
)
{
exdates
.
push_back
(
fromDate
(
QDateTime
(
dt
,
{}),
true
));
}
i
.
setExceptionDates
(
exdates
);
...
...
@@ -775,7 +776,8 @@ template<typename T, typename I> void getTodoEvent(T &i, const I &e)
break
;
case
KCalendarCore
::
Alarm
::
Email
:
{
std
::
vector
<
Kolab
::
ContactReference
>
receipents
;
foreach
(
const
KCalendarCore
::
Person
&
p
,
a
->
mailAddresses
())
{
const
auto
mailAddresses
=
a
->
mailAddresses
();
for
(
const
KCalendarCore
::
Person
&
p
:
mailAddresses
)
{
receipents
.
push_back
(
Kolab
::
ContactReference
(
toStdString
(
p
.
email
()),
toStdString
(
p
.
name
())));
}
alarm
=
Kolab
::
Alarm
(
toStdString
(
a
->
mailSubject
()),
toStdString
(
a
->
mailText
()),
receipents
);
...
...
resources/kolab/pimkolab/freebusy/freebusy.cpp
View file @
c3b6331b
...
...
@@ -183,7 +183,7 @@ Freebusy generateFreeBusy(const QVector<KCalendarCore::Event::Ptr> &events,
// TODO try to merge that with KCalendarCore::Freebusy
std
::
vector
<
Kolab
::
FreebusyPeriod
>
freebusyPeriods
;
Q_FOREACH
(
const
KCalendarCore
::
Event
::
Ptr
&
event
,
events
)
{
for
(
const
KCalendarCore
::
Event
::
Ptr
&
event
:
events
)
{
// If this event is transparent it shouldn't be in the freebusy list.
if
(
event
->
transparency
()
==
KCalendarCore
::
Event
::
Transparent
)
{
continue
;
...
...
resources/kolab/pimkolab/icalendar/icalendar.cpp
View file @
c3b6331b
...
...
@@ -44,7 +44,8 @@ std::vector<Event> fromICalEvents(const std::string &input)
format
.
setApplication
(
QStringLiteral
(
"libkolab"
),
QStringLiteral
(
LIBKOLAB_LIB_VERSION_STRING
));
format
.
fromString
(
calendar
,
Conversion
::
fromStdString
(
input
));
std
::
vector
<
Event
>
events
;
foreach
(
const
KCalendarCore
::
Event
::
Ptr
&
event
,
calendar
->
events
())
{
const
auto
eventsList
=
calendar
->
events
();
for
(
const
KCalendarCore
::
Event
::
Ptr
&
event
:
eventsList
)
{
events
.
push_back
(
Conversion
::
fromKCalendarCore
(
*
event
));
}
return
events
;
...
...
resources/kolab/pimkolab/kolabformat/xmlobject.cpp
View file @
c3b6331b
...
...
@@ -70,7 +70,7 @@ Event XMLObject::readEvent(const std::string &s, Version version)
}
mAttachments
.
clear
();
mAttachments
.
reserve
(
attachments
.
count
());
for
each
(
const
QString
&
attachment
,
attachments
)
{
for
(
const
QString
&
attachment
:
qAsConst
(
attachments
)
)
{
mAttachments
.
push_back
(
Conversion
::
toStdString
(
attachment
));
}
return
Conversion
::
fromKCalendarCore
(
*
event
);
...
...
@@ -114,7 +114,7 @@ Todo XMLObject::readTodo(const std::string &s, Version version)
}
mAttachments
.
clear
();
mAttachments
.
reserve
(
attachments
.
count
());
for
each
(
const
QString
&
attachment
,
attachments
)
{
for
(
const
QString
&
attachment
:
qAsConst
(
attachments
)
)
{
mAttachments
.
push_back
(
Conversion
::
toStdString
(
attachment
));
}
return
Conversion
::
fromKCalendarCore
(
*
event
);
...
...
@@ -158,7 +158,7 @@ Journal XMLObject::readJournal(const std::string &s, Version version)
}
mAttachments
.
clear
();
mAttachments
.
reserve
(
attachments
.
count
());
for
each
(
const
QString
&
attachment
,
attachments
)
{
for
(
const
QString
&
attachment
:
qAsConst
(
attachments
)
)
{
mAttachments
.
push_back
(
Conversion
::
toStdString
(
attachment
));
}
return
Conversion
::
fromKCalendarCore
(
*
event
);
...
...
@@ -316,7 +316,7 @@ Configuration XMLObject::readConfiguration(const std::string &s, Version version
}
std
::
vector
<
std
::
string
>
entries
;
entries
.
reserve
(
dict
.
size
());
for
each
(
const
QString
&
e
,
dict
)
{
for
(
const
QString
&
e
:
qAsConst
(
dict
)
)
{
entries
.
push_back
(
Conversion
::
toStdString
(
e
));
}
Kolab
::
Dictionary
dictionary
(
Conversion
::
toStdString
(
lang
));
...
...
resources/mixedmaildir/autotests/collectionmodifytest.cpp
View file @
c3b6331b
...
...
@@ -397,7 +397,7 @@ void CollectionModifyTest::testIndexPreservation()
items
=
itemFetch
->
items
();
QCOMPARE
((
int
)
items
.
count
(),
4
);
Q_FOREACH
(
const
Item
&
item
,
items
)
{
for
(
const
Item
&
item
:
qAsConst
(
items
)
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
++
flagCounts
[
flag
];
}
...
...
@@ -437,8 +437,9 @@ void CollectionModifyTest::testIndexPreservation()
QCOMPARE
((
int
)
items
.
count
(),
4
);
flagCounts
.
clear
();
Q_FOREACH
(
const
Item
&
item
,
items
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
for
(
const
Item
&
item
:
qAsConst
(
items
))
{
const
auto
flags
=
item
.
flags
();
for
(
const
QByteArray
&
flag
:
flags
)
{
++
flagCounts
[
flag
];
}
}
...
...
@@ -536,8 +537,9 @@ void CollectionModifyTest::testIndexCacheUpdate()
items
=
itemFetch
->
items
();
QCOMPARE
((
int
)
items
.
count
(),
4
);
Q_FOREACH
(
const
Item
&
item
,
items
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
for
(
const
Item
&
item
:
qAsConst
(
items
))
{
const
auto
flags
=
item
.
flags
();
for
(
const
QByteArray
&
flag
:
flags
)
{
++
flagCounts
[
flag
];
}
}
...
...
@@ -554,8 +556,9 @@ void CollectionModifyTest::testIndexCacheUpdate()
items
=
itemFetch
->
items
();
QCOMPARE
((
int
)
items
.
count
(),
4
);
Q_FOREACH
(
const
Item
&
item
,
items
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
for
(
const
Item
&
item
:
qAsConst
(
items
))
{
const
auto
flags
=
item
.
flags
();
for
(
const
QByteArray
&
flag
:
flags
)
{
++
flagCounts
[
flag
];
}
}
...
...
@@ -582,8 +585,9 @@ void CollectionModifyTest::testIndexCacheUpdate()
items
=
itemFetch
->
items
();
QCOMPARE
((
int
)
items
.
count
(),
4
);
Q_FOREACH
(
const
Item
&
item
,
items
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
for
(
const
Item
&
item
:
qAsConst
(
items
))
{
const
auto
flags
=
item
.
flags
();
for
(
const
QByteArray
&
flag
:
flags
)
{
++
flagCounts
[
flag
];
}
}
...
...
@@ -600,8 +604,9 @@ void CollectionModifyTest::testIndexCacheUpdate()
items
=
itemFetch
->
items
();
QCOMPARE
((
int
)
items
.
count
(),
4
);
Q_FOREACH
(
const
Item
&
item
,
items
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
for
(
const
Item
&
item
:
qAsConst
(
items
))
{
const
auto
flags
=
item
.
flags
();
for
(
const
QByteArray
&
flag
:
flags
)
{
++
flagCounts
[
flag
];
}
}
...
...
resources/mixedmaildir/autotests/collectionmovetest.cpp
View file @
c3b6331b
...
...
@@ -154,8 +154,9 @@ void CollectionMoveTest::testMoveToTopLevel()
items
=
itemFetch
->
items
();
QCOMPARE
((
int
)
items
.
count
(),
4
);
Q_FOREACH
(
const
Item
&
item
,
items
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
for
(
const
Item
&
item
:
qAsConst
(
items
))
{
const
auto
flags
=
item
.
flags
();
for
(
const
QByteArray
&
flag
:
flags
)
{
++
flagCounts
[
flag
];
}
}
...
...
@@ -201,8 +202,9 @@ void CollectionMoveTest::testMoveToTopLevel()
items
=
itemFetch
->
items
();
QCOMPARE
((
int
)
items
.
count
(),
4
);
Q_FOREACH
(
const
Item
&
item
,
items
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
for
(
const
Item
&
item
:
qAsConst
(
items
))
{
const
auto
flags
=
item
.
flags
();
for
(
const
QByteArray
&
flag
:
flags
)
{
++
flagCounts
[
flag
];
}
}
...
...
@@ -253,8 +255,9 @@ void CollectionMoveTest::testMoveToTopLevel()
items
=
itemFetch
->
items
();
QCOMPARE
((
int
)
items
.
count
(),
4
);
Q_FOREACH
(
const
Item
&
item
,
items
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
for
(
const
Item
&
item
:
qAsConst
(
items
))
{
const
auto
flags
=
item
.
flags
();
for
(
const
QByteArray
&
flag
:
flags
)
{
++
flagCounts
[
flag
];
}
}
...
...
@@ -300,8 +303,9 @@ void CollectionMoveTest::testMoveToTopLevel()
items
=
itemFetch
->
items
();
QCOMPARE
((
int
)
items
.
count
(),
4
);
Q_FOREACH
(
const
Item
&
item
,
items
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
for
(
const
Item
&
item
:
qAsConst
(
items
))
{
const
auto
flags
=
item
.
flags
();
for
(
const
QByteArray
&
flag
:
flags
)
{
++
flagCounts
[
flag
];
}
}
...
...
@@ -451,8 +455,9 @@ void CollectionMoveTest::testMoveToMaildir()
items
=
itemFetch
->
items
();
QCOMPARE
((
int
)
items
.
count
(),
4
);
Q_FOREACH
(
const
Item
&
item
,
items
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
for
(
const
Item
&
item
:
qAsConst
(
items
))
{
const
auto
flags
=
item
.
flags
();
for
(
const
QByteArray
&
flag
:
flags
)
{
++
flagCounts
[
flag
];
}
}
...
...
@@ -540,8 +545,9 @@ void CollectionMoveTest::testMoveToMaildir()
items
=
itemFetch
->
items
();
QCOMPARE
((
int
)
items
.
count
(),
4
);
Q_FOREACH
(
const
Item
&
item
,
items
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
for
(
const
Item
&
item
:
qAsConst
(
items
))
{
const
auto
flags
=
item
.
flags
();
for
(
const
QByteArray
&
flag
:
flags
)
{
++
flagCounts
[
flag
];
}
}
...
...
@@ -625,8 +631,9 @@ void CollectionMoveTest::testMoveToMaildir()
items
=
itemFetch
->
items
();
QCOMPARE
((
int
)
items
.
count
(),
4
);
Q_FOREACH
(
const
Item
&
item
,
items
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
for
(
const
Item
&
item
:
qAsConst
(
items
))
{
const
auto
flags
=
item
.
flags
();
for
(
const
QByteArray
&
flag
:
flags
)
{
++
flagCounts
[
flag
];
}
}
...
...
@@ -664,8 +671,9 @@ void CollectionMoveTest::testMoveToMaildir()
items
=
itemFetch
->
items
();
QCOMPARE
((
int
)
items
.
count
(),
4
);
Q_FOREACH
(
const
Item
&
item
,
items
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
for
(
const
Item
&
item
:
qAsConst
(
items
))
{
const
auto
flags
=
item
.
flags
();
for
(
const
QByteArray
&
flag
:
flags
)
{
++
flagCounts
[
flag
];
}
}
...
...
@@ -711,8 +719,9 @@ void CollectionMoveTest::testMoveToMaildir()
items
=
itemFetch
->
items
();
QCOMPARE
((
int
)
items
.
count
(),
4
);
Q_FOREACH
(
const
Item
&
item
,
items
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
for
(
const
Item
&
item
:
qAsConst
(
items
))
{
const
auto
flags
=
item
.
flags
();
for
(
const
QByteArray
&
flag
:
flags
)
{
++
flagCounts
[
flag
];
}
}
...
...
@@ -753,8 +762,9 @@ void CollectionMoveTest::testMoveToMaildir()
items
=
itemFetch
->
items
();
QCOMPARE
((
int
)
items
.
count
(),
4
);
Q_FOREACH
(
const
Item
&
item
,
items
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
for
(
const
Item
&
item
:
qAsConst
(
items
))
{
const
auto
flags
=
item
.
flags
();
for
(
const
QByteArray
&
flag
:
flags
)
{
++
flagCounts
[
flag
];
}
}
...
...
@@ -795,8 +805,9 @@ void CollectionMoveTest::testMoveToMaildir()
items
=
itemFetch
->
items
();
QCOMPARE
((
int
)
items
.
count
(),
4
);
Q_FOREACH
(
const
Item
&
item
,
items
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
for
(
const
Item
&
item
:
qAsConst
(
items
))
{
const
auto
flags
=
item
.
flags
();
for
(
const
QByteArray
&
flag
:
flags
)
{
++
flagCounts
[
flag
];
}
}
...
...
@@ -837,8 +848,9 @@ void CollectionMoveTest::testMoveToMaildir()
items
=
itemFetch
->
items
();
QCOMPARE
((
int
)
items
.
count
(),
4
);
Q_FOREACH
(
const
Item
&
item
,
items
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
for
(
const
Item
&
item
:
qAsConst
(
items
))
{
const
auto
flags
=
item
.
flags
();
for
(
const
QByteArray
&
flag
:
flags
)
{
++
flagCounts
[
flag
];
}
}
...
...
resources/mixedmaildir/autotests/itemdeletetest.cpp
View file @
c3b6331b
...
...
@@ -421,8 +421,9 @@ void ItemDeleteTest::testCachePreservation()
items
=
itemFetch
->
items
();
QCOMPARE
((
int
)
items
.
count
(),
3
);
Q_FOREACH
(
const
Item
&
item
,
items
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
for
(
const
Item
&
item
:
qAsConst
(
items
))
{
const
auto
flags
=
item
.
flags
();
for
(
const
QByteArray
&
flag
:
flags
)
{
++
flagCounts
[
flag
];
}
}
...
...
@@ -481,8 +482,9 @@ void ItemDeleteTest::testCachePreservation()
items
=
itemFetch
->
items
();
QCOMPARE
((
int
)
items
.
count
(),
3
);
Q_FOREACH
(
const
Item
&
item
,
items
)
{
Q_FOREACH
(
const
QByteArray
&
flag
,
item
.
flags
())
{
for
(
const
Item
&
item
:
qAsConst
(
items
))
{
const
auto
flags
=
item
.
flags
();
for
(
const
QByteArray
&
flag
:
flags
)
{
++
flagCounts
[
flag
];
}
}
...
...
resources/mixedmaildir/mixedmaildirstore.cpp
View file @
c3b6331b
...
...
@@ -171,7 +171,7 @@ public:
KMBox
::
MBoxEntry
::
List
deletedEntries
;
deletedEntries
.
reserve
(
deleteCount
);
Q_FOREACH
(
quint64
offset
,
mDeletedOffsets
)
{
for
(
quint64
offset
:
qAsConst
(
mDeletedOffsets
)
)
{
deletedEntries
<<
KMBox
::
MBoxEntry
(
offset
);
}
...
...
@@ -1263,7 +1263,7 @@ bool MixedMaildirStore::Private::visit(FileStore::CollectionModifyJob *job)
}
// update collections in MBox contexts so they stay usable for purge
Q_FOREACH
(
const
MBoxPtr
&
mbox
,
mMBoxes
)
{
for
(
const
MBoxPtr
&
mbox
:
qAsConst
(
mMBoxes
)
)
{
if
(
mbox
->
mCollection
.
isValid
())
{
MBoxPtr
updatedMBox
=
mbox
;
updatedMBox
->
mCollection
=
updateMBoxCollectionTree
(
mbox
->
mCollection
,
collection
,
renamedCollection
);
...
...
@@ -1433,7 +1433,7 @@ bool MixedMaildirStore::Private::visit(FileStore::CollectionMoveJob *job)
movedCollection
.
setParentCollection
(
targetCollection
);
// update collections in MBox contexts so they stay usable for purge
Q_FOREACH
(
const
MBoxPtr
&
mbox
,
mMBoxes
)
{
for
(
const
MBoxPtr
&
mbox
:
qAsConst
(
mMBoxes
)
)
{
if
(
mbox
->
mCollection
.
isValid
())
{
MBoxPtr
updatedMBox
=
mbox
;
updatedMBox
->
mCollection
=
updateMBoxCollectionTree
(
mbox
->
mCollection
,
moveCollection
,
movedCollection
);
...
...
resources/pop3/pop3resource.cpp
View file @
c3b6331b
...
...
@@ -715,7 +715,7 @@ QList<int> POP3Resource::shouldDeleteId(int downloadedId) const
}
// Now save the messages from deletion
//
for
each
(
int
idToSave
,
mIdsToSave
)
{
for
(
int
idToSave
:
qAsConst
(
mIdsToSave
)
)
{
idsToDeleteFromServer
.
removeAll
(
idToSave
);
}
if
(
downloadedId
!=
-
1
&&
!
mIdsToSave
.
contains
(
downloadedId
))
{
...
...
Write
Preview
Supports
Markdown
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