]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/iconmanager.cpp
Provide a 'int selectedItemsCount() const' interface for performance reasons, so...
[dolphin.git] / src / iconmanager.cpp
index cde3ab59e0495423e9d3fd01b4fb06c93ae52583..11a3e28641bb104086ec09c407d794a00055d23c 100644 (file)
@@ -361,6 +361,9 @@ void IconManager::resumePreviews()
     }
     m_dispatchedItems.clear();
 
+    m_pendingVisiblePreviews = 0;
+    dispatchPreviewQueue();
+
     KFileItemList orderedItems = m_pendingItems;
     orderItems(orderedItems);
 
@@ -489,7 +492,7 @@ bool IconManager::applyImageFrame(QPixmap& icon)
 void IconManager::limitToSize(QPixmap& icon, const QSize& maxSize)
 {
     if ((icon.width() > maxSize.width()) || (icon.height() > maxSize.height())) {
-        icon = icon.scaled(maxSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
+        icon = icon.scaled(maxSize, Qt::KeepAspectRatio, Qt::FastTransformation);
     }
 }
 
@@ -538,6 +541,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 +567,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 +584,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;
             }
         }