Summary: | new icon view (model/view based) : when deleting images the icon view backs to top | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Salvatore Brigaglia <opensourcecat> |
Component: | Albums-IconView | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | marcel.wiesweg |
Priority: | NOR | ||
Version: | 1.0.0 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 1.0.0 | |
Sentry Crash Report: |
Description
Salvatore Brigaglia
2009-05-20 22:55:41 UTC
Salvatore, Please checkout last code from svn and try again. Marcel work on this part every day... Gilles Caulier niet... still there. This is also reproduceable if you scroll down an album, hide digikam in the task bar and then resume it... it will show the first row of images! Salvatore, I cannot reproduce this problem using last code from svn... Gilles Caulier The same is true when tagging an album and having a filter turned on. For example you open an album, turn on the "Not Tagged" filter, and start tagging images. If you tag them, they will disappear and the view is scrolled back to the top. Before modelview, this was not the case. @4, Andi - actually I like this behavior :) Why? You have 500 images in an album, you set the filter, you tag some items in the middle of the view and than it jumps back... this is not helpful at all. How can you like that? :-) Andi, I mean that images are vanishing from view. Jumping to beginning isn't nice. Yeah sure, removing the items is nice ;-) So we have the same opinion... :-) SVN commit 990995 by mwiesweg: Part A of the problem: Try to preserve selection across layoutChanged(). Simply store one persistent index and one row number to indicate where about the selection was before the layout change. That's not perfect but simple and works for most cases. CCBUG: 193422 M +32 -2 imagecategorizedview.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=990995 SVN commit 991005 by mwiesweg: Part B of the problem: Do not call updateScrollBars after layoutChanged(); everything is invalid! Fix possible crash from Part A's solution. M +6 -3 imagecategorizedview.cpp M +1 -1 kcategorizedview.cpp --- trunk/extragear/graphics/digikam/digikam/imagecategorizedview.cpp #991004:991005 @@ -576,11 +576,14 @@ QModelIndex indexToAnchor; if (currentSelection.contains(current)) indexToAnchor = current; - else + else if (!currentSelection.isEmpty()) indexToAnchor = currentSelection.first().topLeft(); - d->hintAtSelectionRow = indexToAnchor.row(); - d->hintAtSelectionIndex = model()->index(d->hintAtSelectionRow == model()->rowCount() + if (indexToAnchor.isValid()) + { + d->hintAtSelectionRow = indexToAnchor.row(); + d->hintAtSelectionIndex = model()->index(d->hintAtSelectionRow == model()->rowCount() ? d->hintAtSelectionRow : d->hintAtSelectionRow + 1, 0); + } } } --- trunk/extragear/graphics/digikam/digikam/kcategorizedview.cpp #991004:991005 @@ -1769,7 +1769,7 @@ { if (d->proxyModel && d->categoryDrawer && d->proxyModel->isCategorizedModel()) { - d->updateScrollbars(); + // all cached values are invalidated, recompute immediately rowsInsertedArtifficial(QModelIndex(), 0, d->proxyModel->rowCount() - 1); } } For me this problem is solved. If you confirm we can close it. What is left as WONTFIX is the behavior that when the application is minimized and restored, the view is scrolled to the current selected item. That's Qt behavior. So should we close it then...? I think it is solved, closing now. Feel free to re-open it if really necessary. |