From 015957c5a2fb0fed52e1101fb1f67f1f691e799f Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Thu, 20 Jun 2013 19:13:35 +0200 Subject: Make sure that all visible items have an icon We try to determine "final" icons, i.e., icons with known mime type, for 200 ms. If this does not succeed, we at least load "fast" icons, i.e., load the icons without determining the mime type. REVIEW: 111009 --- src/kitemviews/kfileitemmodelrolesupdater.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/kitemviews/kfileitemmodelrolesupdater.h') diff --git a/src/kitemviews/kfileitemmodelrolesupdater.h b/src/kitemviews/kfileitemmodelrolesupdater.h index 2a5a4041c..605c36f81 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.h +++ b/src/kitemviews/kfileitemmodelrolesupdater.h @@ -223,6 +223,15 @@ private: */ void startUpdating(); + /** + * Loads the icons for the visible items. After 200 ms, the function + * stops determining mime types and only loads preliminary icons. + * This is a compromise that prevents that + * (a) the GUI is blocked for more than 200 ms, and + * (b) "unknown" icons could be shown in the view. + */ + void updateVisibleIcons(); + /** * Creates previews for the items starting from the first item in * m_pendingPreviewItems. @@ -311,11 +320,6 @@ private: // Items for which the sort role still has to be determined. QSet m_pendingSortRoleItems; - // While the sort role is being resolved, we also keep the indexes - // in a sorted list. The reason is that this enables us to determine - // both the sort role and the icon for the visible items first. - QList m_pendingSortRoleIndexes; - // Indexes of items which still have to be handled by // resolveNextPendingRoles(). QList m_pendingIndexes; -- cgit v1.3.1