Commit 2914eef8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

port to for(... : ...)

parent 7c68aa0c
......@@ -149,7 +149,7 @@ void CustomFieldsListWidget::loadContact(const KContacts::Addressee &contact)
void CustomFieldsListWidget::storeContact(KContacts::Addressee &contact) const
{
const CustomField::List customFields = mModel->customFields();
foreach (const CustomField &customField, customFields) {
for (const CustomField &customField : customFields) {
// write back values for local and global scope, leave external untouched
if (customField.scope() != CustomField::ExternalScope) {
if (!customField.value().isEmpty()) {
......@@ -213,7 +213,7 @@ void CustomFieldsListWidget::setLocalCustomFieldDescriptions(const QVariantList
{
mLocalCustomFields.clear();
mLocalCustomFields.reserve(descriptions.count());
foreach (const QVariant &description, descriptions) {
for (const QVariant &description : descriptions) {
mLocalCustomFields.append(CustomField::fromVariantMap(description.toMap(), CustomField::LocalScope));
}
}
......@@ -223,7 +223,7 @@ QVariantList CustomFieldsListWidget::localCustomFieldDescriptions() const
const CustomField::List customFields = mModel->customFields();
QVariantList descriptions;
foreach (const CustomField &field, customFields) {
for (const CustomField &field : customFields) {
if (field.scope() == CustomField::LocalScope) {
descriptions.append(field.toVariantMap());
}
......
......@@ -325,7 +325,7 @@ void ImageWidget::saveImage()
{
const QList<QByteArray> supportedImage = QImageWriter::supportedImageFormats();
QString filter;
Q_FOREACH (const QByteArray &ba, supportedImage) {
for (const QByteArray &ba : supportedImage) {
if (!filter.isEmpty()) {
filter += QLatin1Char(' ');
}
......
......@@ -228,7 +228,7 @@ QString StandardContactFormatter::toHtml(HtmlForm form) const
if (!rawContact.customs().empty()) {
const QStringList customs = rawContact.customs();
foreach (QString custom, customs) { //krazy:exclude=foreach
for (QString custom : customs) {
if (custom.startsWith(QStringLiteral("KADDRESSBOOK-"))) {
custom.remove(QStringLiteral("KADDRESSBOOK-X-"));
custom.remove(QStringLiteral("KADDRESSBOOK-"));
......
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