From: Frank Reininghaus Date: Sun, 14 Aug 2011 17:35:06 +0000 (+0200) Subject: Remove incorrect asserts X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/c12f0f8c61d7ec269be689a42836fe4d67a96253 Remove incorrect asserts 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. --- diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index 81b46b1d2..a88116800 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -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);