Hello community,

here is the log from the commit of package kitemmodels for openSUSE:Factory 
checked in at 2019-04-19 21:23:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kitemmodels (Old)
 and      /work/SRC/openSUSE:Factory/.kitemmodels.new.5536 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kitemmodels"

Fri Apr 19 21:23:14 2019 rev:65 rq:695233 version:5.57.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/kitemmodels/kitemmodels.changes  2019-03-21 
09:46:48.766890456 +0100
+++ /work/SRC/openSUSE:Factory/.kitemmodels.new.5536/kitemmodels.changes        
2019-04-19 21:23:16.067788920 +0200
@@ -1,0 +2,11 @@
+Sun Apr 14 20:21:43 UTC 2019 - lbeltr...@kde.org
+
+- Update to 5.57.0
+  * New feature release
+  * For more details please see:
+  * https://www.kde.org/announcements/kde-frameworks-5.57.0.php
+- Changes since 5.56.0:
+  * [kitemmodels] make it compile without foreach
+  * Port deprecated qSort
+
+-------------------------------------------------------------------

Old:
----
  kitemmodels-5.56.0.tar.xz

New:
----
  kitemmodels-5.57.0.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kitemmodels.spec ++++++
--- /var/tmp/diff_new_pack.frWhDH/_old  2019-04-19 21:23:17.767791084 +0200
+++ /var/tmp/diff_new_pack.frWhDH/_new  2019-04-19 21:23:17.791791115 +0200
@@ -18,14 +18,14 @@
 
 %define clang_sonum 3.8
 %define lname   libKF5ItemModels5
-%define _tar_path 5.56
+%define _tar_path 5.57
 # Full KF5 version (e.g. 5.33.0)
 %{!?_kf5_version: %global _kf5_version %{version}}
 # Last major and minor KF5 version (e.g. 5.33)
 %{!?_kf5_bugfix_version: %define _kf5_bugfix_version %(echo %{_kf5_version} | 
awk -F. '{print $1"."$2}')}
 %bcond_with python
 Name:           kitemmodels
-Version:        5.56.0
+Version:        5.57.0
 Release:        0
 Summary:        Set of item models extending the Qt model-view framework
 License:        LGPL-2.1-or-later

++++++ kitemmodels-5.56.0.tar.xz -> kitemmodels-5.57.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-5.56.0/.gitignore 
new/kitemmodels-5.57.0/.gitignore
--- old/kitemmodels-5.56.0/.gitignore   1970-01-01 01:00:00.000000000 +0100
+++ new/kitemmodels-5.57.0/.gitignore   2019-04-07 09:19:04.000000000 +0200
@@ -0,0 +1,21 @@
+# Ignore the following files
+*~
+*.[oa]
+*.diff
+*.kate-swp
+*.kdev4
+.kdev_include_paths
+*.kdevelop.pcs
+*.moc
+*.moc.cpp
+*.orig
+*.user
+.*.swp
+.swp.*
+Doxyfile
+Makefile
+avail
+random_seed
+/build*/
+CMakeLists.txt.user*
+*.unc-backup*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-5.56.0/CMakeLists.txt 
new/kitemmodels-5.57.0/CMakeLists.txt
--- old/kitemmodels-5.56.0/CMakeLists.txt       2019-03-02 14:27:40.000000000 
+0100
+++ new/kitemmodels-5.57.0/CMakeLists.txt       2019-04-07 09:19:04.000000000 
+0200
@@ -1,10 +1,10 @@
 cmake_minimum_required(VERSION 3.5)
 
-set(KF5_VERSION "5.56.0") # handled by release scripts
+set(KF5_VERSION "5.57.0") # handled by release scripts
 project(KItemModels VERSION ${KF5_VERSION})
 
 include(FeatureSummary)
-find_package(ECM 5.56.0  NO_MODULE)
+find_package(ECM 5.57.0  NO_MODULE)
 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake 
Modules." URL 
"https://projects.kde.org/projects/kdesupport/extra-cmake-modules";)
 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND 
FATAL_ON_MISSING_REQUIRED_PACKAGES)
 
@@ -33,7 +33,7 @@
                         VERSION_HEADER 
"${CMAKE_CURRENT_BINARY_DIR}/kitemmodels_version.h"
                         PACKAGE_VERSION_FILE 
"${CMAKE_CURRENT_BINARY_DIR}/KF5ItemModelsConfigVersion.cmake"
                         SOVERSION 5)
-
+add_definitions(-DQT_NO_FOREACH)
 add_subdirectory(src)
 if (BUILD_TESTING)
     add_subdirectory(autotests)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kitemmodels-5.56.0/autotests/proxymodeltestsuite/dynamictreemodel.cpp 
new/kitemmodels-5.57.0/autotests/proxymodeltestsuite/dynamictreemodel.cpp
--- old/kitemmodels-5.56.0/autotests/proxymodeltestsuite/dynamictreemodel.cpp   
2019-03-02 14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/autotests/proxymodeltestsuite/dynamictreemodel.cpp   
2019-04-07 09:19:04.000000000 +0200
@@ -195,7 +195,8 @@
     int _row;
     static const int column = 0;
     QHash<qint64, QList<QList<qint64> > >::const_iterator it;
-    Q_FOREACH (const QByteArray &ba, encoded.split('\0')) {
+    const auto lst = encoded.split('\0');
+    for (const QByteArray &ba : lst) {
         id = ba.toInt(&ok);
         if (!ok) {
             qDebug() << ba;
@@ -237,7 +238,7 @@
         srcPath = indexToPath(srcParent);
 
         rowsMoved = src_parent_it.value();
-        qSort(rowsMoved);
+        std::sort(rowsMoved.begin(), rowsMoved.end());
         src_row_it = rowsMoved.begin();
         rows_moved_end = rowsMoved.end();
         startRow = *src_row_it;
@@ -281,7 +282,7 @@
     }
 
     int offset = firstCommand->endRow() - firstCommand->startRow() + 1;
-    Q_FOREACH (ModelMoveCommand *moveCommand, moveCommands) {
+    for (ModelMoveCommand *moveCommand : qAsConst(moveCommands)) {
         moveCommand->setDestAncestors(indexToPath(destParent));
         moveCommand->setDestRow(destRowIndex.row() + offset);
         moveCommand->doCommand();
@@ -601,8 +602,8 @@
 
     if (!childItemRows.isEmpty()) {
         for (int col = 0; col < m_numCols; col++) {
-            QList<qint64> childItems = childItemRows[col];
-            Q_FOREACH (qint64 item, childItems) {
+            const QList<qint64> childItems = childItemRows[col];
+            for (qint64 item : childItems) {
                 purgeItem(item);
                 m_model->m_childItems[parent][col].removeOne(item);
             }
@@ -679,12 +680,12 @@
 
 void ModelRemoveCommand::purgeItem(qint64 parent)
 {
-    QList<QList<qint64> > childItemRows = m_model->m_childItems.value(parent);
+    const QList<QList<qint64> > childItemRows = 
m_model->m_childItems.value(parent);
 
     if (!childItemRows.isEmpty()) {
         for (int col = 0; col < m_numCols; col++) {
-            QList<qint64> childItems = childItemRows[col];
-            Q_FOREACH (qint64 item, childItems) {
+            const QList<qint64> childItems = childItemRows[col];
+            for (qint64 item : childItems) {
                 purgeItem(item);
                 m_model->m_childItems[parent][col].removeOne(item);
             }
@@ -737,7 +738,7 @@
     }
 
     for (int column = 0; column < m_numCols; ++column) {
-        QList<qint64> l = 
m_model->m_childItems.value(srcParent.internalId())[column].mid(m_startRow, 
m_endRow - m_startRow + 1);
+        const QList<qint64> l = 
m_model->m_childItems.value(srcParent.internalId())[column].mid(m_startRow, 
m_endRow - m_startRow + 1);
 
         for (int i = m_startRow; i <= m_endRow; i++) {
             
m_model->m_childItems[srcParent.internalId()][column].removeAt(m_startRow);
@@ -753,7 +754,7 @@
             }
         }
 
-        Q_FOREACH (const qint64 id, l) {
+        for (const qint64 id : l) {
 
             if (!m_model->m_childItems.contains(destParent.internalId())) {
                 
m_model->m_childItems[destParent.internalId()].append(QList<qint64>());
@@ -926,7 +927,7 @@
     m_model->layoutAboutToBeChanged();
     QModelIndexList oldList;
 
-    Q_FOREACH (const PersistentChange &change, m_changes) {
+    for (const PersistentChange &change : qAsConst(m_changes)) {
         const IndexFinder oldFinder(m_model, change.oldPath);
         oldList << oldFinder.getIndex();
     }
@@ -941,7 +942,7 @@
     }
 
     QModelIndexList newList;
-    Q_FOREACH (const PersistentChange &change, m_changes) {
+    for (const PersistentChange &change : qAsConst(m_changes)) {
         const IndexFinder newFinder(m_model, change.newPath);
         newList << newFinder.getIndex();
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kitemmodels-5.56.0/autotests/proxymodeltestsuite/modeleventlogger.cpp 
new/kitemmodels-5.57.0/autotests/proxymodeltestsuite/modeleventlogger.cpp
--- old/kitemmodels-5.56.0/autotests/proxymodeltestsuite/modeleventlogger.cpp   
2019-03-02 14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/autotests/proxymodeltestsuite/modeleventlogger.cpp   
2019-04-07 09:19:04.000000000 +0200
@@ -155,7 +155,7 @@
 {
     QString result(QStringLiteral("QList<int>()"));
 
-    Q_FOREACH (const int row, m_rowAncestors) {
+    for (const int row : qAsConst(m_rowAncestors)) {
         result.append(" << ");
         result.append(QString::number(row));
     }
@@ -271,7 +271,7 @@
     m_oldPaths.clear();
     m_persistentIndexes.clear();
     const QModelIndexList list = static_cast<const ModelWrapper 
*>(m_model)->per();
-    Q_FOREACH (const QPersistentModelIndex &idx, list) {
+    for (const QPersistentModelIndex &idx : list) {
         m_persistentIndexes.append(idx);
         m_oldPaths.append(IndexFinder::indexToIndexFinder(idx).rows());
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kitemmodels-5.56.0/autotests/proxymodeltestsuite/modeleventlogger.h 
new/kitemmodels-5.57.0/autotests/proxymodeltestsuite/modeleventlogger.h
--- old/kitemmodels-5.56.0/autotests/proxymodeltestsuite/modeleventlogger.h     
2019-03-02 14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/autotests/proxymodeltestsuite/modeleventlogger.h     
2019-04-07 09:19:04.000000000 +0200
@@ -45,7 +45,7 @@
     QString getPath(const QList<int> &path) const
     {
         QString result(QStringLiteral("QList<int>()"));
-        Q_FOREACH (const int part, path) {
+        for (const int part : path) {
             result.append(QLatin1String(" << "));
             result.append(QString::number(part));
         }
@@ -123,7 +123,7 @@
     QVariantList changes() const
     {
         QVariantList list;
-        Q_FOREACH (PersistentChange *change, m_changedPaths) {
+        for (PersistentChange *change : qAsConst(m_changedPaths)) {
             list.append(QVariant::fromValue(static_cast<QObject *>(change)));
         }
         return list;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kitemmodels-5.56.0/autotests/proxymodeltestsuite/modelspy.cpp 
new/kitemmodels-5.57.0/autotests/proxymodeltestsuite/modelspy.cpp
--- old/kitemmodels-5.56.0/autotests/proxymodeltestsuite/modelspy.cpp   
2019-03-02 14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/autotests/proxymodeltestsuite/modelspy.cpp   
2019-04-07 09:19:04.000000000 +0200
@@ -203,16 +203,16 @@
     return list;
 }
 
-QList< QPersistentModelIndex > ModelSpy::toPersistent(QModelIndexList list)
+QList< QPersistentModelIndex > ModelSpy::toPersistent(const QModelIndexList 
&list)
 {
     QList<QPersistentModelIndex > persistentList;
-    Q_FOREACH (const QModelIndex &idx, list) {
+    for (const QModelIndex &idx : list) {
         persistentList << QPersistentModelIndex(idx);
     }
     return persistentList;
 }
 
-QModelIndexList ModelSpy::getUnchangedIndexes(const QModelIndex &parent, 
QList<QItemSelectionRange> ignoredRanges)
+QModelIndexList ModelSpy::getUnchangedIndexes(const QModelIndex &parent, const 
QList<QItemSelectionRange> &ignoredRanges)
 {
     QModelIndexList list;
     int rowCount = m_model->rowCount(parent);
@@ -221,7 +221,7 @@
         QModelIndex idx = m_model->index(row, column, parent);
         Q_ASSERT(idx.isValid());
         bool found = false;
-        Q_FOREACH (const QItemSelectionRange &range, ignoredRanges) {
+        for (const QItemSelectionRange &range : ignoredRanges) {
             if (range.topLeft().parent() == parent &&  range.topLeft().row() 
== idx.row()) {
                 row = range.bottomRight().row() + 1;
                 found = true;
@@ -320,7 +320,7 @@
 QDebug operator<<(QDebug d, ModelSpy *modelSpy)
 {
     d << "ModelSpy(";
-    Q_FOREACH (const QVariantList &list, (QList<QVariantList>)(*modelSpy)) {
+    for (const QVariantList &list : qAsConst(*modelSpy)) {
         d << "SIGNAL(";
         int sigType = list.first().toInt();
         d << signaltypes[sigType];
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kitemmodels-5.56.0/autotests/proxymodeltestsuite/modelspy.h 
new/kitemmodels-5.57.0/autotests/proxymodeltestsuite/modelspy.h
--- old/kitemmodels-5.56.0/autotests/proxymodeltestsuite/modelspy.h     
2019-03-02 14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/autotests/proxymodeltestsuite/modelspy.h     
2019-04-07 09:19:04.000000000 +0200
@@ -99,9 +99,9 @@
 
 private:
     void doPersist();
-    QModelIndexList getUnchangedIndexes(const QModelIndex &parent, QList< 
QItemSelectionRange > ignoredRanges);
+    QModelIndexList getUnchangedIndexes(const QModelIndex &parent, const 
QList<QItemSelectionRange> &ignoredRanges);
     QModelIndexList getDescendantIndexes(const QModelIndex &index);
-    QList< QPersistentModelIndex > toPersistent(QModelIndexList list);
+    QList< QPersistentModelIndex > toPersistent(const QModelIndexList &list);
 
 private:
     QAbstractItemModel *m_model;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kitemmodels-5.56.0/autotests/proxymodeltestsuite/proxymodeltest.cpp 
new/kitemmodels-5.57.0/autotests/proxymodeltestsuite/proxymodeltest.cpp
--- old/kitemmodels-5.56.0/autotests/proxymodeltestsuite/proxymodeltest.cpp     
2019-03-02 14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/autotests/proxymodeltestsuite/proxymodeltest.cpp     
2019-04-07 09:19:04.000000000 +0200
@@ -86,9 +86,9 @@
     if (m_dataTags.contains(ProxyModelTestData::failTag())) {
         return;
     }
-    QSet<QString> unimplemented = 
m_modelCommanderTags.toSet().subtract(m_dataTags.toSet());
+    const QSet<QString> unimplemented = 
m_modelCommanderTags.toSet().subtract(m_dataTags.toSet());
     QString unimplementedTestsString(QStringLiteral("("));
-    Q_FOREACH (const QString &test, unimplemented) {
+    for (const QString &test : unimplemented) {
         unimplementedTestsString.append(test + ",");
     }
     unimplementedTestsString.append(")");
@@ -586,7 +586,8 @@
     QVERIFY(m_modelSpy->isEmpty());
 
     // Persistent indexes should change by the amount described in change 
objects.
-    Q_FOREACH (PersistentIndexChange change, m_modelSpy->getChangeList()) {
+    const auto lst = m_modelSpy->getChangeList();
+    for (PersistentIndexChange change : lst) {
         for (int i = 0; i < change.indexes.size(); i++) {
             QModelIndex idx = change.indexes.at(i);
             QPersistentModelIndex persistentIndex = 
change.persistentIndexes.at(i);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kitemmodels-5.56.0/autotests/proxymodeltestsuite/proxymodeltest.h 
new/kitemmodels-5.57.0/autotests/proxymodeltestsuite/proxymodeltest.h
--- old/kitemmodels-5.56.0/autotests/proxymodeltestsuite/proxymodeltest.h       
2019-03-02 14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/autotests/proxymodeltestsuite/proxymodeltest.h       
2019-04-07 09:19:04.000000000 +0200
@@ -756,7 +756,8 @@
         QList<int> testObjects; \
         QStringList arguments; \
         bool ok; \
-        Q_FOREACH(const QString &arg, app.arguments()) \
+        const auto lst = app.arguments(); \
+        for (const QString &arg : lst) \
         { \
             int testObject = arg.toInt(&ok); \
             if (arg == "-count") \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-5.56.0/autotests/test_model_helpers.h 
new/kitemmodels-5.57.0/autotests/test_model_helpers.h
--- old/kitemmodels-5.56.0/autotests/test_model_helpers.h       2019-03-02 
14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/autotests/test_model_helpers.h       2019-04-07 
09:19:04.000000000 +0200
@@ -32,7 +32,7 @@
 inline QList<QStandardItem *> makeStandardItems(const QStringList &texts)
 {
     QList<QStandardItem *> items;
-    foreach (const QString &txt, texts) {
+    for (const QString &txt : texts) {
         items << new QStandardItem(txt);
     }
     return items;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-5.56.0/src/kbreadcrumbselectionmodel.cpp 
new/kitemmodels-5.57.0/src/kbreadcrumbselectionmodel.cpp
--- old/kitemmodels-5.56.0/src/kbreadcrumbselectionmodel.cpp    2019-03-02 
14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/src/kbreadcrumbselectionmodel.cpp    2019-04-07 
09:19:04.000000000 +0200
@@ -164,16 +164,16 @@
 void KBreadcrumbSelectionModelPrivate::sourceSelectionChanged(const 
QItemSelection &selected, const QItemSelection &deselected)
 {
     Q_Q(KBreadcrumbSelectionModel);
-    QItemSelection deselectedCrumbs = getBreadcrumbSelection(deselected);
-    QItemSelection selectedCrumbs = getBreadcrumbSelection(selected);
+    const QItemSelection deselectedCrumbs = getBreadcrumbSelection(deselected);
+    const QItemSelection selectedCrumbs = getBreadcrumbSelection(selected);
 
     QItemSelection removed = deselectedCrumbs;
-    Q_FOREACH (const QItemSelectionRange &range, selectedCrumbs) {
+    for (const QItemSelectionRange &range : selectedCrumbs) {
         removed.removeAll(range);
     }
 
     QItemSelection added = selectedCrumbs;
-    Q_FOREACH (const QItemSelectionRange &range, deselectedCrumbs) {
+    for (const QItemSelectionRange &range : deselectedCrumbs) {
         added.removeAll(range);
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-5.56.0/src/kcheckableproxymodel.cpp 
new/kitemmodels-5.57.0/src/kcheckableproxymodel.cpp
--- old/kitemmodels-5.56.0/src/kcheckableproxymodel.cpp 2019-03-02 
14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/src/kcheckableproxymodel.cpp 2019-04-07 
09:19:04.000000000 +0200
@@ -117,10 +117,12 @@
 void KCheckableProxyModelPrivate::selectionChanged(const QItemSelection 
&selected, const QItemSelection &deselected)
 {
     Q_Q(KCheckableProxyModel);
-    Q_FOREACH (const QItemSelectionRange &range, 
q->mapSelectionFromSource(selected)) {
+    const auto lstSelected = q->mapSelectionFromSource(selected);
+    for (const QItemSelectionRange &range : lstSelected) {
         emit q->dataChanged(range.topLeft(), range.bottomRight());
     }
-    Q_FOREACH (const QItemSelectionRange &range, 
q->mapSelectionFromSource(deselected)) {
+    const auto lstDeselected = q->mapSelectionFromSource(deselected);
+    for (const QItemSelectionRange &range : lstDeselected) {
         emit q->dataChanged(range.topLeft(), range.bottomRight());
     }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kitemmodels-5.56.0/src/kconcatenaterowsproxymodel.cpp 
new/kitemmodels-5.57.0/src/kconcatenaterowsproxymodel.cpp
--- old/kitemmodels-5.56.0/src/kconcatenaterowsproxymodel.cpp   2019-03-02 
14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/src/kconcatenaterowsproxymodel.cpp   2019-04-07 
09:19:04.000000000 +0200
@@ -314,7 +314,7 @@
 {
     QList<QPersistentModelIndex> parents;
     parents.reserve(sourceParents.size());
-    foreach (const QPersistentModelIndex &parent, sourceParents) {
+    for (const QPersistentModelIndex &parent : sourceParents) {
         if (!parent.isValid()) {
             parents << QPersistentModelIndex();
             continue;
@@ -329,7 +329,7 @@
     const QModelIndexList persistentIndexList = q->persistentIndexList();
     layoutChangePersistentIndexes.reserve(persistentIndexList.size());
 
-    foreach (const QPersistentModelIndex &proxyPersistentIndex, 
persistentIndexList) {
+    for (const QPersistentModelIndex &proxyPersistentIndex : 
persistentIndexList) {
         proxyIndexes << proxyPersistentIndex;
         Q_ASSERT(proxyPersistentIndex.isValid());
         const QPersistentModelIndex srcPersistentIndex = 
q->mapToSource(proxyPersistentIndex);
@@ -351,7 +351,7 @@
 
     QList<QPersistentModelIndex> parents;
     parents.reserve(sourceParents.size());
-    foreach (const QPersistentModelIndex &parent, sourceParents) {
+    for (const QPersistentModelIndex &parent : sourceParents) {
         if (!parent.isValid()) {
             parents << QPersistentModelIndex();
             continue;
@@ -394,7 +394,7 @@
 int KConcatenateRowsProxyModelPrivate::computeRowsPrior(const 
QAbstractItemModel *sourceModel) const
 {
     int rowsPrior = 0;
-    foreach (const QAbstractItemModel *model, m_models) {
+    for (const QAbstractItemModel *model : qAsConst(m_models)) {
         if (model == sourceModel) {
             break;
         }
@@ -407,7 +407,7 @@
 {
     int rowCount = 0;
     QAbstractItemModel *selection = nullptr;
-    foreach (QAbstractItemModel *model, m_models) {
+    for (QAbstractItemModel *model : qAsConst(m_models)) {
         const int subRowCount = model->rowCount();
         if (rowCount + subRowCount > row) {
             selection = model;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-5.56.0/src/kdescendantsproxymodel.cpp 
new/kitemmodels-5.57.0/src/kdescendantsproxymodel.cpp
--- old/kitemmodels-5.56.0/src/kdescendantsproxymodel.cpp       2019-03-02 
14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/src/kdescendantsproxymodel.cpp       2019-04-07 
09:19:04.000000000 +0200
@@ -904,7 +904,8 @@
     emit q->layoutAboutToBeChanged();
 
     QPersistentModelIndex srcPersistentIndex;
-    Q_FOREACH (const QPersistentModelIndex &proxyPersistentIndex, 
q->persistentIndexList()) {
+    const auto lst = q->persistentIndexList();
+    for (const QPersistentModelIndex &proxyPersistentIndex : lst) {
         m_proxyIndexes << proxyPersistentIndex;
         Q_ASSERT(proxyPersistentIndex.isValid());
         srcPersistentIndex = q->mapToSource(proxyPersistentIndex);
@@ -975,7 +976,7 @@
     }
     Q_ASSERT(sourceModel());
     QModelIndexList sourceIndexes;
-    Q_FOREACH (const QModelIndex &index, indexes) {
+    for (const QModelIndex &index : indexes) {
         sourceIndexes << mapToSource(index);
     }
     return sourceModel()->mimeData(sourceIndexes);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-5.56.0/src/kextracolumnsproxymodel.cpp 
new/kitemmodels-5.57.0/src/kextracolumnsproxymodel.cpp
--- old/kitemmodels-5.56.0/src/kextracolumnsproxymodel.cpp      2019-03-02 
14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/src/kextracolumnsproxymodel.cpp      2019-04-07 
09:19:04.000000000 +0200
@@ -275,7 +275,7 @@
 
     QList<QPersistentModelIndex> parents;
     parents.reserve(sourceParents.size());
-    foreach (const QPersistentModelIndex &parent, sourceParents) {
+    for (const QPersistentModelIndex &parent : sourceParents) {
         if (!parent.isValid()) {
             parents << QPersistentModelIndex();
             continue;
@@ -291,7 +291,7 @@
     layoutChangePersistentIndexes.reserve(persistentIndexList.size());
     layoutChangeProxyColumns.reserve(persistentIndexList.size());
 
-    foreach (QPersistentModelIndex proxyPersistentIndex, persistentIndexList) {
+    for (QPersistentModelIndex proxyPersistentIndex : persistentIndexList) {
         proxyIndexes << proxyPersistentIndex;
         Q_ASSERT(proxyPersistentIndex.isValid());
         const int column = proxyPersistentIndex.column();
@@ -323,7 +323,7 @@
 
     QList<QPersistentModelIndex> parents;
     parents.reserve(sourceParents.size());
-    foreach (const QPersistentModelIndex &parent, sourceParents) {
+    for (const QPersistentModelIndex &parent : sourceParents) {
         if (!parent.isValid()) {
             parents << QPersistentModelIndex();
             continue;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-5.56.0/src/klinkitemselectionmodel.cpp 
new/kitemmodels-5.57.0/src/klinkitemselectionmodel.cpp
--- old/kitemmodels-5.56.0/src/klinkitemselectionmodel.cpp      2019-03-02 
14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/src/klinkitemselectionmodel.cpp      2019-04-07 
09:19:04.000000000 +0200
@@ -46,7 +46,7 @@
 
     bool assertSelectionValid(const QItemSelection &selection) const
     {
-        Q_FOREACH (const QItemSelectionRange &range, selection) {
+        for (const QItemSelectionRange &range : selection) {
             if (!range.isValid()) {
                 qCDebug(KITEMMODELS_LOG) << selection;
             }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-5.56.0/src/kmodelindexproxymapper.cpp 
new/kitemmodels-5.57.0/src/kmodelindexproxymapper.cpp
--- old/kitemmodels-5.56.0/src/kmodelindexproxymapper.cpp       2019-03-02 
14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/src/kmodelindexproxymapper.cpp       2019-04-07 
09:19:04.000000000 +0200
@@ -43,7 +43,7 @@
 
     bool assertSelectionValid(const QItemSelection &selection) const
     {
-        Q_FOREACH (const QItemSelectionRange &range, selection) {
+        for (const QItemSelectionRange &range : selection) {
             if (!range.isValid()) {
                 qCDebug(KITEMMODELS_LOG) << selection << m_leftModel << 
m_rightModel << m_proxyChainDown << m_proxyChainUp;
             }
@@ -102,10 +102,10 @@
 
 void KModelIndexProxyMapperPrivate::createProxyChain()
 {
-    Q_FOREACH (auto p, m_proxyChainUp) {
+    for (auto p : qAsConst(m_proxyChainUp)) {
         p->disconnect(q_ptr);
     }
-    Q_FOREACH (auto p, m_proxyChainDown) {
+    for (auto p : qAsConst(m_proxyChainDown)) {
         p->disconnect(q_ptr);
     }
     m_proxyChainUp.clear();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kitemmodels-5.56.0/src/krecursivefilterproxymodel.cpp 
new/kitemmodels-5.57.0/src/krecursivefilterproxymodel.cpp
--- old/kitemmodels-5.56.0/src/krecursivefilterproxymodel.cpp   2019-03-02 
14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/src/krecursivefilterproxymodel.cpp   2019-04-07 
09:19:04.000000000 +0200
@@ -285,7 +285,8 @@
         return list;
 
     QModelIndex proxyIndex;
-    Q_FOREACH (const QModelIndex &idx, 
sourceModel()->match(mapToSource(start), role, value, hits, flags)) {
+    const auto lst = sourceModel()->match(mapToSource(start), role, value, 
hits, flags);
+    for (const QModelIndex &idx : lst) {
         proxyIndex = mapFromSource(idx);
         if (proxyIndex.isValid()) {
             list << proxyIndex;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kitemmodels-5.56.0/src/kselectionproxymodel.cpp 
new/kitemmodels-5.57.0/src/kselectionproxymodel.cpp
--- old/kitemmodels-5.56.0/src/kselectionproxymodel.cpp 2019-03-02 
14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/src/kselectionproxymodel.cpp 2019-04-07 
09:19:04.000000000 +0200
@@ -251,7 +251,7 @@
     // i.e., new items are inserted in the expected location.
 
     QList<QModelIndexList> rootAncestors;
-    Q_FOREACH (const QModelIndex &root, list) {
+    for (const QModelIndex &root : list) {
         QModelIndexList ancestors;
         ancestors << root;
         QModelIndex parent = root.parent();
@@ -768,7 +768,7 @@
     emit q->layoutAboutToBeChanged();
 
     QItemSelection selection;
-    Q_FOREACH (const QModelIndex &rootIndex, m_rootIndexList) {
+    for (const QModelIndex &rootIndex : qAsConst(m_rootIndexList)) {
         // This will be optimized later.
         emit q->rootIndexAboutToBeRemoved(rootIndex);
         selection.append(QItemSelectionRange(rootIndex, rootIndex));
@@ -778,7 +778,8 @@
     emit q->rootSelectionAboutToBeRemoved(selection);
 
     QPersistentModelIndex srcPersistentIndex;
-    Q_FOREACH (const QPersistentModelIndex &proxyPersistentIndex, 
q->persistentIndexList()) {
+    const auto lst = q->persistentIndexList();
+    for (const QPersistentModelIndex &proxyPersistentIndex : lst) {
         m_proxyIndexes << proxyPersistentIndex;
         Q_ASSERT(proxyPersistentIndex.isValid());
         srcPersistentIndex = q->mapToSource(proxyPersistentIndex);
@@ -1083,7 +1084,7 @@
     m_rowsInserted = false;
     endInsertRows(parent, start, end);
     q->endInsertRows();
-    Q_FOREACH (const PendingSelectionChange &pendingChange, 
m_pendingSelectionChanges) {
+    for (const PendingSelectionChange &pendingChange : 
qAsConst(m_pendingSelectionChanges)) {
         selectionChanged(pendingChange.selected, pendingChange.deselected);
     }
     m_pendingSelectionChanges.clear();
@@ -1861,7 +1862,7 @@
                     // range is not a descendant of the selection, but maybe 
the selection is a descendant of range.
                     // no need to check selected here. That's already in 
newRootRanges.
                     // existingRootRanges and newRootRanges do not overlap.
-                    Q_FOREACH (const QItemSelectionRange &selectedRange, 
existingRootRanges) {
+                    for (const QItemSelectionRange &selectedRange : 
existingRootRanges) {
                         const QModelIndex selectedRangeTopLeft = 
selectedRange.topLeft();
                         // existingSelection (and selectedRangeTopLeft) is D.
                         // D is a descendant of B, so when B was removed, D 
might have been exposed as a root.
@@ -1940,7 +1941,8 @@
         return;
     }
 
-    Q_FOREACH (const QModelIndex &newIndex, selection.indexes()) {
+    const auto lst = selection.indexes();
+    for (const QModelIndex &newIndex : lst) {
         Q_ASSERT(newIndex.model() == q->sourceModel());
         if (newIndex.column() > 0) {
             continue;
@@ -2307,7 +2309,7 @@
         return QAbstractProxyModel::mimeData(indexes);
     }
     QModelIndexList sourceIndexes;
-    Q_FOREACH (const QModelIndex &index, indexes) {
+    for (const QModelIndex &index : indexes) {
         sourceIndexes << mapToSource(index);
     }
     return sourceModel()->mimeData(sourceIndexes);
@@ -2465,7 +2467,8 @@
 
     QModelIndexList list;
     QModelIndex proxyIndex;
-    Q_FOREACH (const QModelIndex &idx, 
sourceModel()->match(mapToSource(start), role, value, hits, flags)) {
+    const auto lst = sourceModel()->match(mapToSource(start), role, value, 
hits, flags);
+    for (const QModelIndex &idx : lst) {
         proxyIndex = mapFromSource(idx);
         if (proxyIndex.isValid()) {
             list << proxyIndex;
@@ -2481,7 +2484,7 @@
         // QAbstractProxyModel::mapSelectionFromSource puts invalid ranges in 
the result
         // without checking. We can't have that.
         QItemSelection proxySelection;
-        Q_FOREACH (const QItemSelectionRange &range, selection) {
+        for (const QItemSelectionRange &range : selection) {
             QModelIndex proxyTopLeft = mapFromSource(range.topLeft());
             if (!proxyTopLeft.isValid()) {
                 continue;
@@ -2523,7 +2526,7 @@
         // QAbstractProxyModel::mapSelectionFromSource puts invalid ranges in 
the result
         // without checking. We can't have that.
         QItemSelection sourceSelection;
-        Q_FOREACH (const QItemSelectionRange &range, selection) {
+        for (const QItemSelectionRange &range : selection) {
             QModelIndex sourceTopLeft = mapToSource(range.topLeft());
             Q_ASSERT(sourceTopLeft.isValid());
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kitemmodels-5.56.0/tests/proxymodeltestapp/breadcrumbswidget.cpp 
new/kitemmodels-5.57.0/tests/proxymodeltestapp/breadcrumbswidget.cpp
--- old/kitemmodels-5.56.0/tests/proxymodeltestapp/breadcrumbswidget.cpp        
2019-03-02 14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/tests/proxymodeltestapp/breadcrumbswidget.cpp        
2019-04-07 09:19:04.000000000 +0200
@@ -40,7 +40,7 @@
 
 void MultiSelectionModel::select(const QModelIndex &index, 
QItemSelectionModel::SelectionFlags command)
 {
-    Q_FOREACH (QItemSelectionModel *selectionModel, m_selectionModels) {
+    for (QItemSelectionModel *selectionModel : qAsConst(m_selectionModels)) {
         selectionModel->select(index, command);
     }
     QItemSelectionModel::select(index, command);
@@ -48,7 +48,7 @@
 
 void MultiSelectionModel::select(const QItemSelection &selection, 
QItemSelectionModel::SelectionFlags command)
 {
-    Q_FOREACH (QItemSelectionModel *selectionModel, m_selectionModels) {
+    for (QItemSelectionModel *selectionModel : qAsConst(m_selectionModels)) {
         selectionModel->select(selection, command);
     }
     QItemSelectionModel::select(selection, command);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kitemmodels-5.56.0/tests/proxymodeltestapp/kreparentingproxymodel.cpp 
new/kitemmodels-5.57.0/tests/proxymodeltestapp/kreparentingproxymodel.cpp
--- old/kitemmodels-5.56.0/tests/proxymodeltestapp/kreparentingproxymodel.cpp   
2019-03-02 14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/tests/proxymodeltestapp/kreparentingproxymodel.cpp   
2019-04-07 09:19:04.000000000 +0200
@@ -539,7 +539,7 @@
     if (d->m_pendingRemovalChildIndexes.contains(sourceParent)) {
 //     qDebug() << "#############";
 
-        Q_FOREACH (const KReparentingProxyModelPrivate::PendingRemoval 
&pendingRemoval, d->m_pendingRemovals) {
+        for (const KReparentingProxyModelPrivate::PendingRemoval 
&pendingRemoval : qAsConst(d->m_pendingRemovals)) {
 //       qDebug() << "In" << pendingRemoval.index << 
pendingRemoval.sourceIndex << sourceParent;
             if (pendingRemoval.sourceIndex == sourceParent) {
 //         qDebug() << "Out" << pendingRemoval.sourceIndex << sourceParent;
@@ -666,7 +666,7 @@
 int KReparentingProxyModelPrivate::pendingRemovalRowCount(const QModelIndex 
&sourceIndex) const
 {
 
-    Q_FOREACH (const PendingRemoval &pendingRemoval, m_pendingRemovals) {
+    for (const PendingRemoval &pendingRemoval : qAsConst(m_pendingRemovals)) {
 //     qDebug() << pendingRemoval.sourceIndex;
         if (pendingRemoval.sourceIndex == sourceIndex) {
             return pendingRemoval.end - pendingRemoval.start + 1;
@@ -782,7 +782,7 @@
 
 QHash<QModelIndex, QModelIndexList> 
KReparentingProxyModelPrivate::mergeDescendants(QHash<QModelIndex, 
QModelIndexList> mappings, const QModelIndex &parent, int start)
 {
-    QModelIndexList childIndexes = mappings.take(parent);
+    const QModelIndexList childIndexes = mappings.take(parent);
 //   qDebug() << childIndexes;
     if (!childIndexes.isEmpty()) {
         if (!m_parents.values().contains(parent)) {
@@ -790,7 +790,7 @@
         }
     }
     int row = start;
-    Q_FOREACH (const QModelIndex &idx, childIndexes) {
+    for (const QModelIndex &idx : childIndexes) {
         m_childIndexes[parent].insert(row++, QPersistentModelIndex(idx));
         mappings = mergeDescendants(mappings, idx, 0);
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kitemmodels-5.56.0/tests/proxymodeltestapp/matchcheckingwidget.cpp 
new/kitemmodels-5.57.0/tests/proxymodeltestapp/matchcheckingwidget.cpp
--- old/kitemmodels-5.56.0/tests/proxymodeltestapp/matchcheckingwidget.cpp      
2019-03-02 14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/tests/proxymodeltestapp/matchcheckingwidget.cpp      
2019-04-07 09:19:04.000000000 +0200
@@ -77,14 +77,14 @@
         m_dynamicTreeWidget->treeView()->selectionModel()->clearSelection();
         list = 
m_dynamicTreeWidget->model()->match(m_dynamicTreeWidget->model()->index(0, 0), 
DynamicTreeModel::DynamicTreeModelId, id);
         qDebug() << list;
-        Q_FOREACH (const QModelIndex &idx, list) {
+        for (const QModelIndex &idx : qAsConst(list)) {
             m_dynamicTreeWidget->treeView()->selectionModel()->select(idx, 
QItemSelectionModel::SelectCurrent);
         }
     } else if (m_selectionModelRadioButton->isChecked()) {
         m_selectionTreeView->selectionModel()->clearSelection();
         list = 
m_selectionTreeView->model()->match(m_selectionTreeView->model()->index(0, 0), 
DynamicTreeModel::DynamicTreeModelId, id);
         qDebug() << list;
-        Q_FOREACH (const QModelIndex &idx, list) {
+        for (const QModelIndex &idx : qAsConst(list)) {
             m_selectionTreeView->selectionModel()->select(idx, 
QItemSelectionModel::SelectCurrent);
         }
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kitemmodels-5.56.0/tests/proxymodeltestapp/modelcommanderwidget.cpp 
new/kitemmodels-5.57.0/tests/proxymodeltestapp/modelcommanderwidget.cpp
--- old/kitemmodels-5.56.0/tests/proxymodeltestapp/modelcommanderwidget.cpp     
2019-03-02 14:27:40.000000000 +0100
+++ new/kitemmodels-5.57.0/tests/proxymodeltestapp/modelcommanderwidget.cpp     
2019-04-07 09:19:04.000000000 +0200
@@ -62,7 +62,7 @@
                                       Q_RETURN_ARG(QStringList, testData),
                                       Q_ARG(QString, QString()));
 
-            Q_FOREACH (const QString &testRun, testData) {
+            for (const QString &testRun : qAsConst(testData)) {
               new QTreeWidgetItem(testFunctionItem, QStringList() << testRun);
             }
         }


Reply via email to