]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Prevent some unnecessary layoutings when the view size is changed
authorFrank Reininghaus <frank78ac@googlemail.com>
Tue, 2 Jul 2013 17:12:08 +0000 (19:12 +0200)
committerFrank Reininghaus <frank78ac@googlemail.com>
Tue, 2 Jul 2013 17:13:43 +0000 (19:13 +0200)
In Icons/Details (Compact) View, no layouting is necessary if the view
height (width) changes.

REVIEW: 111322

src/kitemviews/private/kitemlistviewlayouter.cpp

index c15b44e13b1593b77cbd9360272ce1812751e679..da569b3dc6cf0ee97b8b119efd9aaba31ea4eb03 100644 (file)
@@ -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;
     }
 }