Commit 447d9ea4 authored by David Faure's avatar David Faure
Browse files

Port away from Q_FOREACH

parent 6ce509df
......@@ -223,7 +223,7 @@ void FileTypesView::slotFilter(const QString &patternFilter)
}
// insert all items and their group that match the filter
Q_FOREACH (TypesListItem *it, m_itemList) {
for (TypesListItem *it : qAsConst(m_itemList)) {
const MimeTypeData &mimeTypeData = it->mimeTypeData();
if (patternFilter.isEmpty() || mimeTypeData.matchesFilter(patternFilter)) {
TypesListItem *group = m_majorMap.value(mimeTypeData.majorType());
......@@ -412,7 +412,7 @@ void FileTypesView::save()
bool needUpdateSycoca = false;
bool didIt = false;
// first, remove those items which we are asked to remove.
Q_FOREACH (const QString &mime, removedList) {
for (const QString &mime : qAsConst(removedList)) {
MimeTypeWriter::removeOwnMimeType(mime);
didIt = true;
needUpdateMimeDb = true;
......@@ -434,7 +434,7 @@ void FileTypesView::save()
}
++it1;
}
Q_FOREACH (TypesListItem *tli, m_itemList) {
for (TypesListItem *tli : qAsConst(m_itemList)) {
if (tli->mimeTypeData().isDirty()) {
if (tli->mimeTypeData().isServiceListDirty()) {
needUpdateSycoca = true;
......@@ -496,7 +496,7 @@ void FileTypesView::slotDatabaseChanged(const QStringList &changedResources)
// important for Apply (how to differentiate those 2?).
// See BR 35071.
Q_FOREACH (TypesListItem *tli, m_itemList) {
for (TypesListItem *tli : qAsConst(m_itemList)) {
tli->mimeTypeData().refresh();
}
}
......
......@@ -169,7 +169,7 @@ void KServiceListWidget::setMimeTypeData(MimeTypeData *mimeTypeData)
servicesLB->addItem(i18nc("No components associated with this file type", "None"));
}
} else {
Q_FOREACH (const QString &service, services) {
for (const QString &service : services) {
KService::Ptr pService = KService::serviceByStorageId(service);
if (pService) {
servicesLB->addItem(new KServiceListItem(pService, m_kind));
......
......@@ -481,11 +481,11 @@ void MimeTypeData::saveRemovedServices(KConfigGroup &config, const QStringList &
{
QStringList removedServiceList = config.readXdgListEntry(name());
Q_FOREACH (const QString &service, services) {
for (const QString &service : services) {
// If removedServiceList.contains(service), then it was previously removed but has been added back
removedServiceList.removeAll(service);
}
Q_FOREACH (const QString &oldService, oldServices) {
for (const QString &oldService : oldServices) {
if (!services.contains(oldService)) {
// The service was in m_appServices (or m_embedServices) but has been removed
removedServiceList.append(oldService);
......
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