From e43f29576d4666a66cd4d236418baf403f176069 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 28 Sep 2011 20:04:31 +0200 Subject: Details view: Improve performance when expanding items Prevent unnecessary calls to visibleRolesSizes() when expanding items. Also the performance has been improved when resizing the window. --- src/kitemviews/kfileitemlistview.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'src/kitemviews/kfileitemlistview.cpp') diff --git a/src/kitemviews/kfileitemlistview.cpp b/src/kitemviews/kfileitemlistview.cpp index f1594b10b..d3de2c8c9 100644 --- a/src/kitemviews/kfileitemlistview.cpp +++ b/src/kitemviews/kfileitemlistview.cpp @@ -198,29 +198,11 @@ QHash KFileItemListView::visibleRolesSizes(const KItemRangeL maxTimeExceeded = true; break; } + ++calculatedItemCount; } if (maxTimeExceeded) { break; } - ++calculatedItemCount; - } - - // Stretch the width of the first role so that the full visible view-width - // is used to show all roles. - const qreal availableWidth = size().width(); - - qreal usedWidth = 0; - QHashIterator it(sizes); - while (it.hasNext()) { - it.next(); - usedWidth += it.value().width(); - } - - if (usedWidth < availableWidth) { - const QByteArray role = visibleRoles().first(); - QSizeF firstRoleSize = sizes.value(role); - firstRoleSize.rwidth() += availableWidth - usedWidth; - sizes.insert(role, firstRoleSize); } #ifdef KFILEITEMLISTVIEW_DEBUG -- cgit v1.3