| Summary: | Crash in Compact View when the view height is insufficient to show an item and a key is pressed | ||
|---|---|---|---|
| Product: | [Applications] dolphin | Reporter: | Frank Reininghaus <frank78ac> |
| Component: | general | Assignee: | Peter Penz <peter.penz19> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | ||
| Priority: | NOR | ||
| Version First Reported In: | 2.0 | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | 4.8.1 | |
| Sentry Crash Report: | |||
| Attachments: | Possible fix for the problem | ||
|
Description
Frank Reininghaus
2012-01-29 18:29:12 UTC
Created attachment 68309 [details]
Possible fix for the problem
Thanks Frank! The patch looks good, please just push it to master + 4.8 Ah, just had a second look: Probably this would make the code more maintainable:
if (!viewGeometry.contains(currentRect)) {
qreal newOffset = scrollOffset();
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.left() < viewGeometry.left()) {
newOffset += currentRect.left() - viewGeometry.left();
} else if (currentRect.right() > viewGeometry.right()) {
newOffset += currentRect.right() - viewGeometry.right();
}
}
if (newOffset != scrollOffset()) {
emit scrollTo(newOffset);
}
}
Just a suggestion :-)
Git commit f5ecaee9c40c940fe8e1bf4a7d50fe0b18e1932b by Frank Reininghaus. Committed on 30/01/2012 at 10:07. Pushed by freininghaus into branch 'KDE/4.8'. Fix crash in Compact View if view height is smaller then item height FIXED-IN: 4.8.1 M +9 -11 dolphin/src/kitemviews/kitemlistview.cpp http://commits.kde.org/kde-baseapps/f5ecaee9c40c940fe8e1bf4a7d50fe0b18e1932b Git commit 61cd43249f4ea928bf0a591e466fea9436e2e304 by Frank Reininghaus. Committed on 30/01/2012 at 10:07. Pushed by freininghaus into branch 'master'. Fix crash in Compact View if view height is smaller then item height FIXED-IN: 4.8.1 (cherry picked from commit f5ecaee9c40c940fe8e1bf4a7d50fe0b18e1932b) M +9 -11 dolphin/src/kitemviews/kitemlistview.cpp http://commits.kde.org/kde-baseapps/61cd43249f4ea928bf0a591e466fea9436e2e304 |