mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
Use mutable iterators where required
This commit is contained in:
parent
97415729c3
commit
2448f88c5f
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue