From: Frank Reininghaus Date: Tue, 2 Jul 2013 17:12:08 +0000 (+0200) Subject: Prevent some unnecessary layoutings when the view size is changed X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/82ea33762ffcc75cece3269fedb5380afc86b05d 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 --- diff --git a/src/kitemviews/private/kitemlistviewlayouter.cpp b/src/kitemviews/private/kitemlistviewlayouter.cpp index c15b44e13..da569b3dc 100644 --- a/src/kitemviews/private/kitemlistviewlayouter.cpp +++ b/src/kitemviews/private/kitemlistviewlayouter.cpp @@ -73,8 +73,16 @@ Qt::Orientation KItemListViewLayouter::scrollOrientation() const void KItemListViewLayouter::setSize(const QSizeF& 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_dirty = true; + m_visibleIndexesDirty = true; } }