From 151c8d8c42115717151d88e17b55b60a74b5e791 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Mon, 22 Apr 2013 21:21:31 +0200 Subject: Always determine icons for the visible items first When entering a folder, KFileItemModelRolesUpdater has not yet been informed about the visible index range by the view when it tries to determine icons synchronously. This resulted in the problem that it tried to determine icons for all items in random order, and some visible icons were somtimes still unknown after the "synchronous icon loading" timeout of 200 ms. This commit tries to improve the situation by loading icons starting with the first item in increasing order. This should make it less likely that some visible items still have unknown icons after 200 ms. BUG: 316129 FIXED-IN: 4.10.3 REVIEW: 109843 --- src/kitemviews/kitemlistview.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/kitemviews/kitemlistview.cpp') diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index 9ebad7f8b..763b7e68f 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -208,6 +208,11 @@ qreal KItemListView::maximumItemOffset() const return m_layouter->maximumItemOffset(); } +int KItemListView::maximumVisibleItems() const +{ + return m_layouter->maximumVisibleItems(); +} + void KItemListView::setVisibleRoles(const QList& roles) { const QList previousRoles = m_visibleRoles; -- cgit v1.3 From 37e796522b3864758edb7756d60c44b4929200f3 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Mon, 22 Apr 2013 21:36:57 +0200 Subject: Comment out assertion to fix a crash when filtering in Icons/Compat View I'm not sure yet if there is a problem somewhere else in the code. For the time being, I think it's better to replace the assert by a TODO comment to prevent that users find out the hard way that there is something that we're not quite sure about. BUG: 317827 FIXED-IN: 4.10.3 --- src/kitemviews/kitemlistview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/kitemviews/kitemlistview.cpp') diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index 763b7e68f..a2629c565 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -1147,7 +1147,10 @@ void KItemListView::slotItemsRemoved(const KItemRangeList& itemRanges) // Important: Don't read any m_layouter-property inside the for-loop in case if // multiple ranges are given! m_layouter accesses m_sizeHintResolver which is // updated in each loop-cycle and has only a consistent state after the loop. - Q_ASSERT(m_layouter->isDirty()); + // TODO: This assert can be hit when filtering in Icons and Compact view, + // see https://bugs.kde.org/show_bug.cgi?id=317827 comments 2 and 3. + // We should try to figure out if the assert is wrong or if there is a bug in the code. + //Q_ASSERT(m_layouter->isDirty()); #endif m_endTransactionAnimationHint = NoAnimation; endTransaction(); -- cgit v1.3