Commit c74a1258 authored by Laurent Montel's avatar Laurent Montel 😁

Port some foreach

parent 126cfb78
......@@ -178,7 +178,7 @@ void HistoryTest::testDeletion()
waitForSignals();
// Check that it doesn't exist anymore
foreach (const Akonadi::Item &item, items) {
for (const Akonadi::Item &item : qAsConst(items)) {
QVERIFY(Helper::confirmDoesntExist(item));
}
......@@ -528,7 +528,7 @@ void HistoryTest::deleteFinished(int changeId,
qDebug() << "Error string is " << errorMessage;
} else {
QVERIFY(!deletedIds.isEmpty());
foreach (Akonadi::Item::Id id, deletedIds) {
for (Akonadi::Item::Id id : qAsConst(deletedIds)) {
QVERIFY(id != -1);
}
}
......
......@@ -297,8 +297,7 @@ private Q_SLOTS:
if (expectedResultCode == IncidenceChanger::ResultCodeSuccess) {
// Check that the incidence was really deleted
Item item;
foreach (const Akonadi::Item &item, items) {
for (const Akonadi::Item &item : qAsConst(items)) {
ItemFetchJob *fetchJob = new ItemFetchJob(item, this);
fetchJob->fetchScope().fetchFullPayload();
QVERIFY(!fetchJob->exec());
......@@ -1239,7 +1238,7 @@ public Q_SLOTS:
qDebug() << "Error string is " << errorMessage;
} else {
QVERIFY(!deletedIds.isEmpty());
foreach (Akonadi::Item::Id id, deletedIds) {
for (Akonadi::Item::Id id : qAsConst(deletedIds)) {
QVERIFY(id != -1);
}
}
......
......@@ -209,7 +209,7 @@ bool ICalImporter::importIntoExistingResource(const QUrl &url, Akonadi::Collecti
}
d->m_pendingRequests.clear();
Incidence::List incidences = temporaryCalendar->incidences();
const Incidence::List incidences = temporaryCalendar->incidences();
if (incidences.isEmpty()) {
d->setErrorMessage(i18n("The ical file to merge is empty."));
......@@ -232,7 +232,7 @@ bool ICalImporter::importIntoExistingResource(const QUrl &url, Akonadi::Collecti
const IncidenceChanger::DestinationPolicy policySaved = d->m_changer->destinationPolicy();
d->m_changer->startAtomicOperation(i18n("Merge ical file into existing calendar."));
d->m_changer->setDestinationPolicy(IncidenceChanger::DestinationPolicyNeverAsk);
foreach (const Incidence::Ptr &incidence, incidences) {
for (const Incidence::Ptr &incidence : qAsConst(incidences)) {
Q_ASSERT(incidence);
if (!incidence) {
continue;
......
......@@ -91,7 +91,7 @@ void IncidenceChanger::Private::onCollectionsLoaded(KJob *job)
bool noAcl = false;
bool invalidCollection = false;
Collection collectionToUse;
foreach (const Change::Ptr &change, mPendingCreations) {
foreach (const Change::Ptr &change, mPendingCreations) { //Don't use for(...:...) here.
mPendingCreations.removeAll(change);
if (canceled) {
......
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