summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Reininghaus <frank78ac@googlemail.com>2012-01-30 09:07:03 (GMT)
committerFrank Reininghaus <frank78ac@googlemail.com>2012-01-30 09:07:03 (GMT)
commitf5ecaee9c40c940fe8e1bf4a7d50fe0b18e1932b (patch)
tree22a5cbf0d84d582680dd111cf8a242ac16d7515f
parent84bb46aa4b913fa138ee10841ecb64ab323a9009 (diff)
Fix crash in Compact View if view height is smaller then item height
BUG: 292816 FIXED-IN: 4.8.1
-rw-r--r--dolphin/src/kitemviews/kitemlistview.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/dolphin/src/kitemviews/kitemlistview.cpp b/dolphin/src/kitemviews/kitemlistview.cpp
index 5788657..4b2c742 100644
--- a/dolphin/src/kitemviews/kitemlistview.cpp
+++ b/dolphin/src/kitemviews/kitemlistview.cpp
@@ -508,18 +508,16 @@ void KItemListView::scrollToItem(int index)
if (!viewGeometry.contains(currentRect)) {
qreal newOffset = scrollOffset();
- if (currentRect.top() < viewGeometry.top()) {
- Q_ASSERT(scrollOrientation() == Qt::Vertical);
- newOffset += currentRect.top() - viewGeometry.top();
- } else if ((currentRect.bottom() > viewGeometry.bottom())) {
- Q_ASSERT(scrollOrientation() == Qt::Vertical);
- newOffset += currentRect.bottom() - viewGeometry.bottom();
- } else if (currentRect.left() < viewGeometry.left()) {
- if (scrollOrientation() == Qt::Horizontal) {
- newOffset += currentRect.left() - viewGeometry.left();
+ if (scrollOrientation() == Qt::Vertical) {
+ if (currentRect.top() < viewGeometry.top()) {
+ newOffset += currentRect.top() - viewGeometry.top();
+ } else if (currentRect.bottom() > viewGeometry.bottom()) {
+ newOffset += currentRect.bottom() - viewGeometry.bottom();
}
- } else if ((currentRect.right() > viewGeometry.right())) {
- if (scrollOrientation() == Qt::Horizontal) {
+ } else {
+ if (currentRect.left() < viewGeometry.left()) {
+ newOffset += currentRect.left() - viewGeometry.left();
+ } else if (currentRect.right() > viewGeometry.right()) {
newOffset += currentRect.right() - viewGeometry.right();
}
}