diff --git a/libnotificationmanager/notificationgroupingproxymodel.cpp b/libnotificationmanager/notificationgroupingproxymodel.cpp index a17eba98a..8ec91266e 100644 --- a/libnotificationmanager/notificationgroupingproxymodel.cpp +++ b/libnotificationmanager/notificationgroupingproxymodel.cpp @@ -87,13 +87,9 @@ void NotificationGroupingProxyModel::adjustMap(int anchor, int delta) { for (int i = 0; i < rowMap.count(); ++i) { QVector *sourceRows = rowMap.at(i); - QMutableVectorIterator it(*sourceRows); - - while (it.hasNext()) { - it.next(); - - if (it.value() >= anchor) { - it.setValue(it.value() + delta); + for (auto it = sourceRows->begin(); it != sourceRows->end(); ++it) { + if ((*it) >= anchor) { + *it += delta; } } } diff --git a/libtaskmanager/taskgroupingproxymodel.cpp b/libtaskmanager/taskgroupingproxymodel.cpp index 65b827b60..ce94d3dce 100644 --- a/libtaskmanager/taskgroupingproxymodel.cpp +++ b/libtaskmanager/taskgroupingproxymodel.cpp @@ -239,13 +239,9 @@ void TaskGroupingProxyModel::Private::adjustMap(int anchor, int delta) { for (int i = 0; i < rowMap.count(); ++i) { QVector *sourceRows = rowMap.at(i); - QMutableVectorIterator it(*sourceRows); - - while (it.hasNext()) { - it.next(); - - if (it.value() >= anchor) { - it.setValue(it.value() + delta); + for (auto it = sourceRows->begin(); it != sourceRows->end(); ++it) { + if ((*it) >= anchor) { + *it += delta; } } } diff --git a/libtaskmanager/tasksmodel.cpp b/libtaskmanager/tasksmodel.cpp index 4aaf5132d..0cb932006 100644 --- a/libtaskmanager/tasksmodel.cpp +++ b/libtaskmanager/tasksmodel.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -218,13 +219,9 @@ void TasksModel::Private::initModels() } const int delta = (end - start) + 1; - QMutableListIterator it(sortedPreFilterRows); - - while (it.hasNext()) { - it.next(); - - if (it.value() >= start) { - it.setValue(it.value() + delta); + for (auto it = sortedPreFilterRows.begin(); it != sortedPreFilterRows.end(); ++it) { + if ((*it) >= start) { + *it += delta; } } @@ -271,13 +268,9 @@ void TasksModel::Private::initModels() } const int delta = (last - first) + 1; - QMutableListIterator it(sortedPreFilterRows); - - while (it.hasNext()) { - it.next(); - - if (it.value() > last) { - it.setValue(it.value() - delta); + for (auto it = sortedPreFilterRows.begin(); it != sortedPreFilterRows.end(); ++it) { + if ((*it) > last) { + *it -= delta; } } });