[Digikam-devel] [Bug 193422] new icon view (model/view based) : when deleting images the icon view backs to top

Marcel Wiesweg marcel.wiesweg at gmx.de
Fri Jul 3 18:51:13 BST 2009


https://bugs.kde.org/show_bug.cgi?id=193422





--- Comment #10 from Marcel Wiesweg <marcel wiesweg gmx de>  2009-07-03 19:51:09 ---
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);
     }
 }

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Digikam-devel mailing list