Commit 126cfb78 authored by Laurent Montel's avatar Laurent Montel 😁

Port to for(...:...)

parent 9da3b7ed
......@@ -616,14 +616,14 @@ void ITIPHandlerTest::testIdentity()
void ITIPHandlerTest::cleanup()
{
Akonadi::Item::List items = calendarItems();
foreach (const Akonadi::Item &item, items) {
const Akonadi::Item::List items = calendarItems();
for (const Akonadi::Item &item : items) {
ItemDeleteJob *job = new ItemDeleteJob(item);
AKVERIFYEXEC(job);
}
delete m_itipHandler;
m_itipHandler = 0;
m_itipHandler = nullptr;
}
void ITIPHandlerTest::createITIPHandler()
......@@ -662,9 +662,9 @@ void ITIPHandlerTest::processItip(const QString &icaldata, const QString &receiv
Attendee::Ptr ITIPHandlerTest::ourAttendee(const KCalCore::Incidence::Ptr &incidence) const
{
KCalCore::Attendee::List attendees = incidence->attendees();
const KCalCore::Attendee::List attendees = incidence->attendees();
KCalCore::Attendee::Ptr me;
foreach (const KCalCore::Attendee::Ptr &attendee, attendees) {
for (const KCalCore::Attendee::Ptr &attendee : attendees) {
if (attendee->email() == QLatin1String(s_ourEmail)) {
me = attendee;
break;
......
......@@ -116,10 +116,10 @@ void UnitTestBase::compareCalendars(const KCalCore::Calendar::Ptr &expectedCalen
// Now compare the expected calendar to the calendar we got.
Incidence::List incidences = calendar->incidences();
Incidence::List expectedIncidences = expectedCalendar->incidences();
const Incidence::List expectedIncidences = expectedCalendar->incidences();
// First, replace the randomly generated UIDs with the UID that came in the invitation e-mail...
foreach(const KCalCore::Incidence::Ptr &incidence, incidences) {
for(const KCalCore::Incidence::Ptr &incidence : incidences) {
incidence->setUid(incidence->schedulingID());
qDebug() << "We have incidece with uid=" << incidence->uid()
<< "; instanceidentifier=" << incidence->instanceIdentifier();
......@@ -129,7 +129,7 @@ void UnitTestBase::compareCalendars(const KCalCore::Calendar::Ptr &expectedCalen
}
// ... so we can compare them
foreach(const KCalCore::Incidence::Ptr &incidence, expectedIncidences) {
for(const KCalCore::Incidence::Ptr &incidence : expectedIncidences) {
incidence->setUid(incidence->schedulingID());
qDebug() << "We expect incidece with uid=" << incidence->uid()
<< "; instanceidentifier=" << incidence->instanceIdentifier();
......
......@@ -226,7 +226,7 @@ void CalendarClipboard::cutIncidence(const KCalCore::Incidence::Ptr &incidence,
d->getIncidenceHierarchy(incidence, uids);
Q_ASSERT(!uids.isEmpty());
KCalCore::Incidence::List incidencesToCut;
foreach (const QString &uid, uids) {
for (const QString &uid : qAsConst(uids)) {
KCalCore::Incidence::Ptr child = d->m_calendar->incidence(uid);
if (child) {
incidencesToCut << child;
......@@ -264,7 +264,7 @@ bool CalendarClipboard::copyIncidence(const KCalCore::Incidence::Ptr &incidence,
QStringList uids;
d->getIncidenceHierarchy(incidence, uids);
Q_ASSERT(!uids.isEmpty());
foreach (const QString &uid, uids) {
for (const QString &uid : qAsConst(uids)) {
KCalCore::Incidence::Ptr child = d->m_calendar->incidence(uid);
if (child) {
incidencesToCopy << child;
......
......@@ -183,11 +183,11 @@ void History::Private::updateIds(Item::Id oldId, Item::Id newId)
{
mEntryInProgress->updateIds(oldId, newId);
foreach (const Entry::Ptr &entry, mUndoStack) {
for (const Entry::Ptr &entry : qAsConst(mUndoStack)) {
entry->updateIds(oldId, newId);
}
foreach (const Entry::Ptr &entry, mRedoStack) {
for (const Entry::Ptr &entry : qAsConst(mRedoStack)) {
entry->updateIds(oldId, newId);
}
}
......@@ -228,7 +228,7 @@ void History::Private::handleFinished(IncidenceChanger::ResultCode changerResult
// was in progress
if (!mQueuedEntries.isEmpty()) {
mRedoStack.clear();
foreach (const Entry::Ptr &entry, mQueuedEntries) {
for (const Entry::Ptr &entry : qAsConst(mQueuedEntries)) {
mUndoStack.push(entry);
}
mQueuedEntries.clear();
......
......@@ -182,7 +182,7 @@ bool DeletionEntry::undo()
mErrorString.clear();
const bool useAtomicOperation = mItems.count() > 1 ;
bool success = true;
foreach (const Akonadi::Item &item, mItems) {
for (const Akonadi::Item &item : qAsConst(mItems)) {
if (useAtomicOperation) {
mChanger->startAtomicOperation();
}
......
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