Commit 881fccd4 authored by Laurent Montel's avatar Laurent Montel 😁

Port some foreach

parent 22b27f85
......@@ -33,7 +33,7 @@ using namespace IncidenceEditorNG;
void ConflictResolverTest::insertAttendees()
{
foreach (CalendarSupport::FreeBusyItem::Ptr item, attendees) {
foreach (const CalendarSupport::FreeBusyItem::Ptr &item, qAsConst(attendees)) {
resolver->insertAttendee(item);
}
}
......
......@@ -71,9 +71,8 @@ void AttendeeComboBoxDelegate::setStandardIndex(int index)
QWidget *AttendeeComboBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &/* option */, const QModelIndex &/* index */) const
{
AttendeeComboBox *editor = new AttendeeComboBox(parent);
QPair<QIcon, QString> pair;
foreach (pair, mEntries) {
for (const QPair<QIcon, QString> &pair : qAsConst(mEntries)) {
editor->addItem(pair.first, pair.second);
}
......
......@@ -238,7 +238,7 @@ void IncidenceAlarm::updateAlarmList()
const QModelIndex currentIndex = mUi->mAlarmList->currentIndex();
mUi->mAlarmList->clear();
foreach (const KCalCore::Alarm::Ptr &alarm, mAlarms) {
for (const KCalCore::Alarm::Ptr &alarm : qAsConst(mAlarms)) {
mUi->mAlarmList->addItem(stringForAlarm(alarm));
if (alarm->enabled()) {
++mEnabledAlarmCount;
......
......@@ -94,7 +94,7 @@ KCalCore::Person::Ptr IncidenceDefaultsPrivate::organizerAsPerson() const
if (!mGroupWareDomain.isEmpty()) {
// Check if we have an identity with an email that ends with the groupware
// domain.
foreach (const QString &fullEmail, mEmails) {
for (const QString &fullEmail : qAsConst(mEmails)) {
QString name;
QString email;
const bool success = KEmailAddress::extractEmailAddressAndName(fullEmail, email, name);
......@@ -109,7 +109,7 @@ KCalCore::Person::Ptr IncidenceDefaultsPrivate::organizerAsPerson() const
if (organizer->email() == invalidEmail) {
// Either, no groupware was used, or we didn't find a groupware email address.
// Now try to
foreach (const QString &fullEmail, mEmails) {
for (const QString &fullEmail : qAsConst(mEmails)) {
QString name;
QString email;
const bool success = KEmailAddress::extractEmailAddressAndName(fullEmail, email, name);
......@@ -380,7 +380,7 @@ void IncidenceDefaults::setDefaults(const KCalCore::Incidence::Ptr &incidence) c
#ifdef KDEPIM_ENTERPRISE_BUILD
incidence->addAttendee(d->organizerAsAttendee(organizerAsPerson));
#endif
foreach (const KCalCore::Attendee::Ptr &attendee, d->mAttendees) {
for (const KCalCore::Attendee::Ptr &attendee : qAsConst(d->mAttendees)) {
incidence->addAttendee(attendee);
}
// Ical standard: No attendees -> must not have an organizer!
......@@ -388,7 +388,7 @@ void IncidenceDefaults::setDefaults(const KCalCore::Incidence::Ptr &incidence) c
incidence->setOrganizer(organizerAsPerson);
}
foreach (const KCalCore::Attachment::Ptr &attachment, d->mAttachments) {
for (const KCalCore::Attachment::Ptr &attachment : qAsConst(d->mAttachments)) {
incidence->addAttachment(attachment);
}
......
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