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 b7669b6536
commit 1594edb157

View file

@ -73,8 +73,16 @@ 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) {
if (m_scrollOrientation == Qt::Vertical) {
if (m_size.width() != size.width()) {
m_dirty = true;
}
} else if (m_size.height() != size.height()) {
m_dirty = true;
}
m_size = size; m_size = size;
m_dirty = true; m_visibleIndexesDirty = true;
} }
} }