diff options
| author | Peter Penz <[email protected]> | 2011-09-28 20:04:31 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-09-28 20:06:58 +0200 |
| commit | e43f29576d4666a66cd4d236418baf403f176069 (patch) | |
| tree | 3b53d949837b56060a4973891338cdbad5e5b348 /src/kitemviews/kfileitemlistview.cpp | |
| parent | ec38f1cdb641f0b277100edd92b268ec856e2ece (diff) | |
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.
Diffstat (limited to 'src/kitemviews/kfileitemlistview.cpp')
| -rw-r--r-- | src/kitemviews/kfileitemlistview.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
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<QByteArray, QSizeF> 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<QByteArray, QSizeF> 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 |
