[Digikam-devel] [Bug 143200] Renaming like crasy with F2 crash digikam

Marcel Wiesweg marcel.wiesweg at gmx.de
Mon Apr 2 21:14:41 BST 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=143200         




------- Additional Comments From marcel.wiesweg gmx de  2007-04-02 22:14 -------
SVN commit 649546 by mwiesweg:

Trying to fix the problem with rapid renaming, suspecting that the ImageInfo object
is deleted when returning from the event loop.
Does it fix the problem?

CCBUG: 143200



 M  +6 -2      albumiconview.cpp  


--- trunk/extragear/graphics/digikam/digikam/albumiconview.cpp #649545:649546
 @ -794,6 +794,10  @
     if (!item)
         return;
 
+    // Create a copy of the item. After entering the event loop
+    // in the dialog, we cannot be sure about the item's status.
+    ImageInfo renameInfo(*item->imageInfo());
+
     QFileInfo fi(item->imageInfo()->name());
     QString ext  = QString(".") + fi.extension(false);
     QString name = fi.fileName();
 @ -814,7 +818,7  @
     if (!ok)
         return;
 
-    KURL oldURL = item->imageInfo()->kurlForKIO();
+    KURL oldURL = renameInfo.kurlForKIO();
     KURL newURL = oldURL;
     newURL.setFileName(newName + ext);
 
 @ -828,7 +832,7  @
     // When this is completed, DIO will call AlbumLister::instance()->refresh().
     // Usually the AlbumLister will ignore changes to already listed items.
     // So the renamed item need explicitly be invalidated.
-    d->imageLister->invalidateItem(item->imageInfo());
+    d->imageLister->invalidateItem(&renameInfo);
 }
 
 void AlbumIconView::slotRenamed(KIO::Job*, const KURL &, const KURL&newURL)



More information about the Digikam-devel mailing list