From c12f0f8c61d7ec269be689a42836fe4d67a96253 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Sun, 14 Aug 2011 19:35:06 +0200 Subject: [PATCH] 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. --- src/kitemviews/kitemlistview.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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); -- 2.47.3