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

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

parent 06bd1e04
......@@ -322,16 +322,14 @@ QString GrantleeContactFormatter::toHtml(HtmlForm form) const
// IM
QVariantList imAddresses;
const QStringList customs = rawContact.customs();
if (!customs.empty()) {
foreach (const QString &custom, customs) {
if (custom.startsWith(QStringLiteral("messaging/"))) {
int pos = custom.indexOf(QLatin1Char(':'));
QString key = custom.left(pos);
key.remove(QStringLiteral("-All"));
const QString value = custom.mid(pos + 1);
imAddresses.append(imAddressHash(key, value));
}
for (const QString &custom : customs) {
if (custom.startsWith(QStringLiteral("messaging/"))) {
int pos = custom.indexOf(QLatin1Char(':'));
QString key = custom.left(pos);
key.remove(QStringLiteral("-All"));
const QString value = custom.mid(pos + 1);
imAddresses.append(imAddressHash(key, value));
}
}
......
......@@ -41,38 +41,36 @@ ContactGrantleePrintObject::ContactGrantleePrintObject(const KContacts::Addresse
{
const auto addresses = address.addresses();
mListAddress.reserve(addresses.size());
Q_FOREACH (const KContacts::Address &addr, addresses) {
for (const KContacts::Address &addr : addresses) {
mListAddress << new ContactGrantleeAddressObject(addr);
}
const auto webSites = address.extraUrlList();
mListWebSite.reserve(webSites.size());
Q_FOREACH (const KContacts::ResourceLocatorUrl &webSite, webSites) {
for (const KContacts::ResourceLocatorUrl &webSite : webSites) {
mListWebSite << new ContactGrantleeWebSite(webSite);
}
const auto phoneNumbers = address.phoneNumbers();
mListPhones.reserve(phoneNumbers.size());
Q_FOREACH (const KContacts::PhoneNumber &phone, phoneNumbers) {
for (const KContacts::PhoneNumber &phone : phoneNumbers) {
mListPhones << new ContactGrantleePhoneObject(phone);
}
const auto emails = address.emailList();
mListEmails.reserve(emails.size());
Q_FOREACH (const KContacts::Email &email, emails) {
for (const KContacts::Email &email : emails) {
mListEmails << new ContactGrantleeEmail(mAddress, email);
}
const QStringList customs = mAddress.customs();
if (!customs.empty()) {
Q_FOREACH (const QString &custom, customs) {
if (custom.startsWith(QStringLiteral("messaging/"))) {
const int pos = custom.indexOf(QLatin1Char(':'));
QString key = custom.left(pos);
key.remove(QStringLiteral("-All"));
const QString value = custom.mid(pos + 1);
mListIm << new ContactGrantleeImObject(key, value);
}
for (const QString &custom : customs) {
if (custom.startsWith(QStringLiteral("messaging/"))) {
const int pos = custom.indexOf(QLatin1Char(':'));
QString key = custom.left(pos);
key.remove(QStringLiteral("-All"));
const QString value = custom.mid(pos + 1);
mListIm << new ContactGrantleeImObject(key, value);
}
}
mGeoObject = new ContactGrantleeGeoObject(address.geo());
......
......@@ -56,7 +56,7 @@ QString GrantleePrint::contactsToHtml(const KContacts::Addressee::List &contacts
const int numberContacts(contacts.count());
lst.reserve(numberContacts);
contactsList.reserve(numberContacts);
Q_FOREACH (const KContacts::Addressee &address, contacts) {
for (const KContacts::Addressee &address : contacts) {
ContactGrantleePrintObject *contactPrintObject = new ContactGrantleePrintObject(address);
lst.append(contactPrintObject);
contactsList << QVariant::fromValue(static_cast<QObject *>(contactPrintObject));
......
......@@ -70,7 +70,7 @@ void FollowUpReminder::FollowUpReminderUtil::writeFollowupReminderInfo(KSharedCo
const QString groupName = FollowUpReminder::FollowUpReminderUtil::followUpReminderPattern().arg(identifier);
// first, delete all filter groups:
const QStringList filterGroups = config->groupList();
foreach (const QString &group, filterGroups) {
for (const QString &group : filterGroups) {
if (group == groupName) {
config->deleteGroup(group);
}
......@@ -97,10 +97,10 @@ bool FollowUpReminder::FollowUpReminderUtil::removeFollowupReminderInfo(KSharedC
KConfigGroup general = config->group(QStringLiteral("General"));
int value = general.readEntry("Number", 0);
Q_FOREACH (qint32 identifier, listRemove) {
for (qint32 identifier : listRemove) {
const QString groupName = FollowUpReminder::FollowUpReminderUtil::followUpReminderPattern().arg(identifier);
const QStringList filterGroups = config->groupList();
foreach (const QString &group, filterGroups) {
for (const QString &group : filterGroups) {
if (group == groupName) {
config->deleteGroup(group);
......
......@@ -86,7 +86,7 @@ void SendLater::SendLaterUtil::writeSendLaterInfo(KSharedConfig::Ptr config, Sen
const QString groupName = SendLater::SendLaterUtil::sendLaterPattern().arg(info->itemId());
// first, delete all filter groups:
const QStringList filterGroups = config->groupList();
foreach (const QString &group, filterGroups) {
for (const QString &group : filterGroups) {
if (group == groupName) {
config->deleteGroup(group);
}
......
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