Commit 127a3ee7 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port some Q_FOREACH

parent 7849719a
Pipeline #70022 passed with stage
in 11 minutes and 34 seconds
......@@ -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 {
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
}
}
......
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