Remove even more redundant data from KItemListViewLayouter

Review Request #114460 - Created Dec. 14, 2013 and submitted

Information
Frank Reininghaus
kde-baseapps
master
Reviewers
dolphin
After https://git.reviewboard.kde.org/r/113487/, KItemListViewLayouter still stores quite a bit of redundant data.

For every item, we store the coordinates of its top-left corner in a QPointF 'pos' in the ItemInfo struct. This requires

2 * "number of items" doubles.

However, pos.x is the same for all items in one column, and pos.y is the same for all items in a row. Therefore, some memory can be saved by removing the 'pos' member, and adding two QVector<qreal>

m_rowOffsets and m_columnOffsets

instead. This reduces the memory requirement to

"number of rows + number of columns" doubles, which is at least 50% less.
Verfified with KSysGuard that the memory consumption is reduced as expected. View layout and scrolling still seem to work OK in all view modes and with grouping enabled or disabled.

Issues

  • 11
  • 0
  • 0
  • 11
Description From Last Updated
m_itemInfos[index] -> m_itemInfos.at(index) Emmanuel Pescosta Emmanuel Pescosta
m_itemInfos[index] -> m_itemInfos.at(index) Emmanuel Pescosta Emmanuel Pescosta
m_itemInfos[index] -> m_itemInfos.at(index) Emmanuel Pescosta Emmanuel Pescosta
m_itemInfos[index] -> m_itemInfos.at(index) Emmanuel Pescosta Emmanuel Pescosta
m_itemInfos[mid] -> m_itemInfos.at(mid) Emmanuel Pescosta Emmanuel Pescosta
m_itemInfos[mid] -> m_itemInfos.at(mid) Emmanuel Pescosta Emmanuel Pescosta
m_itemInfos[mid] -> m_itemInfos.at(mid) Emmanuel Pescosta Emmanuel Pescosta
m_itemInfos[mid] -> m_itemInfos.at(mid) Emmanuel Pescosta Emmanuel Pescosta
m_itemInfos[mid - 1] -> m_itemInfos.at(mid - 1) Emmanuel Pescosta Emmanuel Pescosta
m_itemInfos[mid] -> m_itemInfos.at(mid) Emmanuel Pescosta Emmanuel Pescosta
m_itemInfos[mid] -> m_itemInfos.at(mid) Emmanuel Pescosta Emmanuel Pescosta
Emmanuel Pescosta
Emmanuel Pescosta
Commit Hook
This review has been submitted with commit de3a06a268dc947872d41cb70b137a0f0889aa05 by Frank Reininghaus to branch master.
Frank Reininghaus
Review request changed

Status: Closed (submitted)

Loading...