]> cloud.milkyroute.net Git - dolphin.git/commit
Prevent storing some redundant data in KItemListViewLayouter
authorFrank Reininghaus <frank78ac@googlemail.com>
Wed, 30 Oct 2013 16:39:20 +0000 (17:39 +0100)
committerFrank Reininghaus <frank78ac@googlemail.com>
Wed, 30 Oct 2013 16:40:23 +0000 (17:40 +0100)
commite518cea0cf91056fe7ff391b916623fb0654dff4
tree4366b67388e0e31732f212fb134d7119413e60bf
parent5a019aec3ac47363ed46e843d0c7eab6a6c2aeb9
Prevent storing some redundant data in KItemListViewLayouter

In KItemListViewLayouter, we have always stored a QRectF for each item,
which is "the area that the item occupies". However, the size of the
QRectF is already stored in the size hint resolver.

Therefore, it is sufficient to store the position of the top left
corner of the QRectF in a QPointF and construct the QRectF on demand.

This patch reduces the memory usage by 16 bytes for each item in the
view:

* a QRectF is 4 doubles -> 32 byes
* a QPointF contains only 2 doubles -> 16 bytes

REVIEW: 113487
src/kitemviews/private/kitemlistviewlayouter.cpp
src/kitemviews/private/kitemlistviewlayouter.h