]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Remove incorrect asserts
authorFrank Reininghaus <frank78ac@googlemail.com>
Sun, 14 Aug 2011 17:35:06 +0000 (19:35 +0200)
committerFrank Reininghaus <frank78ac@googlemail.com>
Sun, 14 Aug 2011 17:35:06 +0000 (19:35 +0200)
They could lead to crashes if the Details View is used and the
view is not wide enough to show all columns for the items.

src/kitemviews/kitemlistview.cpp

index 81b46b1d2e801190c6a4d623f61f1c125c59b7dc..a88116800f8ea034178a44f73eae9708678b7695 100644 (file)
@@ -627,12 +627,14 @@ void KItemListView::slotCurrentChanged(int current, int previous)
             newOffset += currentBoundingRect.bottom() - viewGeometry.bottom();
         }
         else if (currentBoundingRect.left() < viewGeometry.left()) {
-            Q_ASSERT(scrollOrientation() == Qt::Horizontal);
-            newOffset += currentBoundingRect.left() - viewGeometry.left();
+            if (scrollOrientation() == Qt::Horizontal) {
+                newOffset += currentBoundingRect.left() - viewGeometry.left();
+            }
         }
         else if ((currentBoundingRect.right() > viewGeometry.right())) {
-            Q_ASSERT(scrollOrientation() == Qt::Horizontal);
-            newOffset += currentBoundingRect.right() - viewGeometry.right();
+            if (scrollOrientation() == Qt::Horizontal) {
+                newOffset += currentBoundingRect.right() - viewGeometry.right();
+            }
         }
 
         emit scrollTo(newOffset);