From 2448f88c5f42d7a2040fcf3bcd3c5f2a2f62cd03 Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Sat, 24 Oct 2020 16:46:34 +0200 Subject: Use mutable iterators where required --- src/kitemviews/kfileitemmodel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/kitemviews/kfileitemmodel.cpp') diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index b89fe4f58..08407d1ef 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -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 it(m_urlsToExpand); + while (it.hasNext()) { + const QUrl url = it.next(); const int indexForUrl = index(url); if (indexForUrl >= 0) { m_urlsToExpand.remove(url); -- cgit v1.3