Commit 2448f88c authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Use mutable iterators where required

parent 97415729
......@@ -917,7 +917,9 @@ void KFileItemModel::slotCompleted()
// Note that the parent folder must be expanded before any of its subfolders become visible.
// Therefore, some URLs in m_restoredExpandedUrls might not be visible yet
// -> we expand the first visible URL we find in m_restoredExpandedUrls.
for (const QUrl& url : qAsConst(m_urlsToExpand)) {
QMutableSetIterator<QUrl> it(m_urlsToExpand);
while (it.hasNext()) {
const QUrl url = it.next();
const int indexForUrl = index(url);
if (indexForUrl >= 0) {
m_urlsToExpand.remove(url);
......
......@@ -943,7 +943,9 @@ void KFileItemModelRolesUpdater::updateChangedItems()
QList<int> visibleChangedIndexes;
QList<int> invisibleChangedIndexes;
for (const KFileItem& item : qAsConst(m_changedItems)) {
QMutableSetIterator<KFileItem> it(m_changedItems);
while (it.hasNext()) {
const KFileItem item = it.next();
const int index = m_model->index(item);
if (index < 0) {
......
......@@ -1155,7 +1155,10 @@ void KItemListView::slotItemsRemoved(const KItemRangeList& itemRanges)
QVector<int> itemsToMove;
// Remove all KItemListWidget instances that got deleted
for (KItemListWidget* widget : qAsConst(m_visibleItems)) {
QMutableHashIterator<int, KItemListWidget*> it(m_visibleItems);
while (it.hasNext()) {
it.next();
KItemListWidget* widget = it.value();
const int i = widget->index();
if (i < firstRemovedIndex) {
continue;
......
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