Fwd: extragear/graphics/digikam/digikam

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: extragear/graphics/digikam/digikam

Bugzilla from andi.clemens@gmx.net
Marcel,

still crashing here. Should I give you a new backtrace?

Andi


SVN commit 972420 by mwiesweg:

Fix categoryAt(). Should affect dragging crashes.

 M  +10 -8     kcategorizedview.cpp  


--- trunk/extragear/graphics/digikam/digikam/kcategorizedview.cpp #972419:972420
@@ -646,25 +646,27 @@
         return QModelIndex();
     }
 
-    int y = 0;
-    QString lastCategory, foundCategory;
+    // We traverse the categories and find the first where point.y() is below the visualRect
+    int y = 0, lastY = 0;
+    QString lastCategory;
     foreach (const QString &category, d->categories)
     {
-        QRect visualRect = d->categoryVisualRect(category);
+        y = d->categoryVisualRect(category).top();
 
-        if (point.y() >= y && point.y() < visualRect.top())
+        if (point.y() >= lastY && point.y() < y)
         {
-            foundCategory = lastCategory;
             break;
         }
 
-        y = visualRect.top();
+        lastY = y;
+        y = 0;
         lastCategory = category;
     }
 
-    if (!foundCategory.isNull())
+    // if lastCategory is the last one in the list y will be 0
+    if (!lastCategory.isNull() && point.y() >= lastY && (point.y() < y || !y))
     {
-        return d->categoriesIndexes[foundCategory][0];
+        return d->categoriesIndexes[lastCategory][0];
     }
     return QModelIndex();
 }

_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: extragear/graphics/digikam/digikam

Bugzilla from andi.clemens@gmx.net
Here is the updated backtrace..

Andi

On Sunday 24 May 2009 23:26:54 Andi Clemens wrote:
> Marcel,
>
> still crashing here. Should I give you a new backtrace?
>
> Andi


_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel

draganddropcrash.txt (6K) Download Attachment