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
Akonadi
Commits
127a3ee7
Commit
127a3ee7
authored
Jul 12, 2021
by
Laurent Montel
😁
Browse files
Port some Q_FOREACH
parent
7849719a
Pipeline
#70022
passed with stage
in 11 minutes and 34 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
autotests/libs/itemmovetest.cpp
View file @
127a3ee7
...
...
@@ -100,7 +100,7 @@ private Q_SLOTS:
QTRY_COMPARE
(
moveSpy
.
count
(),
1
);
const
Akonadi
::
Item
::
List
&
ntfItems
=
moveSpy
.
takeFirst
().
at
(
0
).
value
<
Akonadi
::
Item
::
List
>
();
QCOMPARE
(
ntfItems
.
size
(),
items
.
size
());
Q_FOREACH
(
const
Item
&
ntfItem
,
ntfItems
)
{
for
(
const
Item
&
ntfItem
:
ntfItems
)
{
if
(
destination
.
id
()
>=
0
)
{
QCOMPARE
(
ntfItem
.
parentCollection
().
id
(),
destination
.
id
());
}
else
{
...
...
autotests/libs/monitornotificationtest.cpp
View file @
127a3ee7
...
...
@@ -179,7 +179,7 @@ void MonitorNotificationTest::testFillPipeline_impl(MonitorImpl *monitor, FakeCo
QVERIFY
(
monitor
->
pipeline
().
isEmpty
());
QVERIFY
(
monitor
->
pendingNotifications
().
isEmpty
());
Q_FOREACH
(
const
Protocol
::
ChangeNotificationPtr
&
ntf
,
list
)
{
for
(
const
Protocol
::
ChangeNotificationPtr
&
ntf
:
std
::
as_const
(
list
)
)
{
monitor
->
notificationConnection
()
->
emitNotify
(
ntf
);
}
...
...
@@ -266,7 +266,7 @@ void MonitorNotificationTest::testMonitor_impl(MonitorImpl *monitor, FakeCollect
QTRY_VERIFY
(
monitor
->
pipeline
().
isEmpty
());
QVERIFY
(
monitor
->
pendingNotifications
().
isEmpty
());
Q_FOREACH
(
const
Protocol
::
ChangeNotificationPtr
&
ntf
,
list
)
{
for
(
const
Protocol
::
ChangeNotificationPtr
&
ntf
:
std
::
as_const
(
list
)
)
{
monitor
->
notificationConnection
()
->
emitNotify
(
ntf
);
}
...
...
autotests/libs/testresource/knutresource.cpp
View file @
127a3ee7
...
...
@@ -121,7 +121,7 @@ void KnutResource::retrieveCollections()
const
Collection
::
List
collections
=
mDocument
.
collections
();
collectionsRetrieved
(
collections
);
const
Tag
::
List
tags
=
mDocument
.
tags
();
Q_FOREACH
(
const
Tag
&
tag
,
tags
)
{
for
(
const
Tag
&
tag
:
tags
)
{
auto
createjob
=
new
TagCreateJob
(
tag
);
createjob
->
setMergeIfExisting
(
true
);
}
...
...
autotests/server/itemcreatehandlertest.cpp
View file @
127a3ee7
...
...
@@ -82,7 +82,7 @@ public:
void
updateParts
(
QVector
<
FakePart
>
&
parts
,
const
std
::
vector
<
PartHelper
>
&
updatedParts
)
{
parts
.
clear
();
Q_FOREACH
(
const
PartHelper
&
helper
,
updatedParts
)
{
for
(
const
PartHelper
&
helper
:
updatedParts
)
{
FakePart
part
;
const
QStringList
types
=
helper
.
type
.
split
(
QLatin1Char
(
':'
));
...
...
@@ -120,7 +120,7 @@ public:
void
updateTags
(
QVector
<
FakeTag
>
&
tags
,
const
std
::
vector
<
TagHelper
>
&
updatedTags
)
{
tags
.
clear
();
Q_FOREACH
(
const
TagHelper
&
helper
,
updatedTags
)
{
for
(
const
TagHelper
&
helper
:
updatedTags
)
{
FakeTag
tag
;
TagType
tagType
;
...
...
src/core/itemserializerplugin.cpp
View file @
127a3ee7
...
...
@@ -39,7 +39,8 @@ QSet<QByteArray> ItemSerializerPlugin::availableParts(const Item &item) const
void
ItemSerializerPlugin
::
apply
(
Item
&
item
,
const
Item
&
other
)
{
Q_FOREACH
(
const
QByteArray
&
part
,
other
.
loadedPayloadParts
())
{
const
auto
loadedPayloadParts
{
other
.
loadedPayloadParts
()};
for
(
const
QByteArray
&
part
:
loadedPayloadParts
)
{
QByteArray
partData
;
QBuffer
buffer
;
buffer
.
setBuffer
(
&
partData
);
...
...
src/server/handler/collectionfetchhandler.cpp
View file @
127a3ee7
...
...
@@ -265,7 +265,8 @@ void CollectionFetchHandler::retrieveCollections(const Collection &topParent, in
if
(
!
qb
.
exec
())
{
throw
HandlerException
(
"Unable to retrieve collection for listing"
);
}
Q_FOREACH
(
const
Collection
&
col
,
qb
.
result
())
{
const
auto
result
{
qb
.
result
()};
for
(
const
Collection
&
col
:
result
)
{
mCollections
.
insert
(
col
.
id
(),
col
);
}
}
...
...
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