Prevent some unnecessary layoutings when the view size is changed

In Icons/Details (Compact) View, no layouting is necessary if the view
height (width) changes.

REVIEW: 111322
This commit is contained in:
Frank Reininghaus 2013-07-02 19:12:08 +02:00
parent 2a612e12ce
commit 82ea33762f

View file

@ -73,9 +73,17 @@ Qt::Orientation KItemListViewLayouter::scrollOrientation() const
void KItemListViewLayouter::setSize(const QSizeF& size) void KItemListViewLayouter::setSize(const QSizeF& size)
{ {
if (m_size != size) { if (m_size != size) {
m_size = size; if (m_scrollOrientation == Qt::Vertical) {
if (m_size.width() != size.width()) {
m_dirty = true; m_dirty = true;
} }
} else if (m_size.height() != size.height()) {
m_dirty = true;
}
m_size = size;
m_visibleIndexesDirty = true;
}
} }
QSizeF KItemListViewLayouter::size() const QSizeF KItemListViewLayouter::size() const