┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-06-29 22:25:02 +0000
committerPeter Penz <[email protected]>2008-06-29 22:25:02 +0000
commit9226a063b0c93b04689134b61fdbafc21c3e6827 (patch)
tree61c8eccce7fbab9294a21fafea57aa9e683837d1 /src
parentdbe0566f43e52122d5556de2441dc5d24e04d1b7 (diff)
when moving the visible items to the front of the list, take care not to reverse the order
svn path=/trunk/KDE/kdebase/apps/; revision=826161
Diffstat (limited to 'src')
-rw-r--r--src/iconmanager.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/iconmanager.cpp b/src/iconmanager.cpp
index 82c35ea7d..ddd7797b2 100644
--- a/src/iconmanager.cpp
+++ b/src/iconmanager.cpp
@@ -538,6 +538,7 @@ void IconManager::orderItems(KFileItemList& items)
const int rowCount = m_proxyModel->rowCount();
const QRect visibleArea = m_view->viewport()->rect();
+ int insertPos = 0;
if (itemCount * 10 > rowCount) {
// Algorithm 1: The number of items is > 10 % of the row count. Parse all rows
// and check whether the received row is part of the item list.
@@ -563,7 +564,8 @@ void IconManager::orderItems(KFileItemList& items)
// to the front of the list, so that the preview is
// generated earlier.
items.removeAt(index);
- items.insert(0, item);
+ items.insert(insertPos, item);
+ ++insertPos;
++m_pendingVisiblePreviews;
}
}
@@ -579,8 +581,9 @@ void IconManager::orderItems(KFileItemList& items)
// The current item is (at least partly) visible. Move it
// to the front of the list, so that the preview is
// generated earlier.
- items.insert(0, items[i]);
+ items.insert(insertPos, items[i]);
items.removeAt(i + 1);
+ ++insertPos;
++m_pendingVisiblePreviews;
}
}