┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kfileitemmodel.cpp
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2020-11-08 23:24:12 +0100
committerElvis Angelaccio <[email protected]>2020-11-08 23:24:12 +0100
commite5d137b81debbbfe51c18d16d361fd28a3448416 (patch)
tree20814229aeefd2f063f81c6775648cb1893c724d /src/kitemviews/kfileitemmodel.cpp
parentdd9e25cde577178b11301809607bc5e79d2eb0a9 (diff)
parentf6327ffec89a33623983e0ed1cc09f46aeedc91c (diff)
Merge branch 'release/20.12'
Diffstat (limited to 'src/kitemviews/kfileitemmodel.cpp')
-rw-r--r--src/kitemviews/kfileitemmodel.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp
index c06202fd8..dbbd63a6a 100644
--- a/src/kitemviews/kfileitemmodel.cpp
+++ b/src/kitemviews/kfileitemmodel.cpp
@@ -919,9 +919,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.
- QMutableSetIterator<QUrl> it(m_urlsToExpand);
- while (it.hasNext()) {
- const QUrl url = it.next();
+ // Iterate over a const copy because items are deleted and inserted within the loop
+ const auto urlsToExpand = m_urlsToExpand;
+ for(const QUrl &url : urlsToExpand) {
const int indexForUrl = index(url);
if (indexForUrl >= 0) {
m_urlsToExpand.remove(url);