[Digikam-devel] [Bug 135307] After deleting a file, user comments entered for pictures apply to the wrong picture

Marcel Wiesweg marcel.wiesweg at gmx.de
Mon Oct 9 16:04:34 CEST 2006


------- 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=135307         




------- Additional Comments From marcel.wiesweg gmx de  2006-10-09 16:04 -------
SVN commit 593903 by mwiesweg:

- get rid of SyncJob here, use standard AlbumThumbnailLoader and change menu entry
  when icon is available. The event loop of SyncJob caused a bug very difficult to find,
  when the ImageLoaded event was actually received in the event loop opened by SyncJob,
  called from handling the ImageLoadingStarted event in the end.
  All assumptions about the order of events are thwarted.
- Handle the AlbumsCleared signal from AlbumManager here as well

CCBUG: 135307


 M  +27 -3     imagedescedittab.cpp  
 M  +1 -0      imagedescedittab.h  


--- trunk/extragear/graphics/digikam/libs/imageproperties/imagedescedittab.cpp #593902:593903
 @ -62,7 +62,6  @
 #include "album.h"
 #include "albumsettings.h"
 #include "tagcreatedlg.h"
-#include "syncjob.h"
 #include "navigatebarwidget.h"
 #include "imageinfo.h"
 #include "ratingwidget.h"
 @ -281,6 +280,9  @
     connect(man, SIGNAL(signalAlbumRenamed(Album*)),
             this, SLOT(slotAlbumRenamed(Album*)));
     
+    connect(man, SIGNAL(signalAlbumsCleared()),
+            this, SLOT(slotAlbumsCleared()));
+    
     connect(man, SIGNAL(signalAlbumIconChanged(Album*)),
             this, SLOT(slotAlbumIconChanged(Album*)));
 
 @ -497,6 +499,7  @
     updateRating();
     updateDate();
     updateTagsView();
+    update();
 }
 
 void ImageDescEditTab::updateTagsView()
 @ -788,6 +791,11  @
     album->removeExtraData(this);
 }
 
+void ImageDescEditTab::slotAlbumsCleared()
+{
+    d->tagsView->clear();
+}
+
 void ImageDescEditTab::slotAlbumIconChanged(Album* a)
 {
     if (!a || a->isRoot() || a->type() != Album::TAG)
 @ -844,12 +852,20  @
     if(!album || album->type() != Album::TAG)
         return;
 
+    // update item in tags tree
     QCheckListItem* item = (QCheckListItem*)album->extraData(this);
 
     if(!item)
         return;
 
     item->setPixmap(0, thumbnail);
+
+    // update item in recent tags popup menu, if found therein
+    QPopupMenu *menu = d->recentTagsBtn->popup();
+    if (menu->indexOf(album->id()) != -1)
+    {
+        menu->changeItem(album->id(), thumbnail, menu->text(album->id()));
+    }
 }
 
 void ImageDescEditTab::slotThumbnailLost(Album *)
 @ -915,9 +931,17  @
             TAlbum* album = albumMan->findTAlbum(*it);
             if (album)
             {
-                QPixmap pix = SyncJob::getTagThumbnail(album);
+                AlbumThumbnailLoader *loader = AlbumThumbnailLoader::instance();
+                QPixmap icon;
+                if (!loader->getTagThumbnail(album, icon))
+                {
+                    if (icon.isNull())
+                    {
+                        icon = loader->getStandardTagIcon(album, 20);
+                    }
+                }
                 QString text = album->title() + " (" + ((TAlbum*)album->parent())->prettyURL() + ")";
-                menu->insertItem(pix, text, album->id());
+                menu->insertItem(icon, text, album->id());
             }
         }
     }
--- trunk/extragear/graphics/digikam/libs/imageproperties/imagedescedittab.h #593902:593903
 @ -109,6 +109,7  @
     void slotAlbumDeleted(Album* a);
     void slotAlbumIconChanged(Album* a);
     void slotAlbumRenamed(Album* a);
+    void slotAlbumsCleared();
 
     void slotGotThumbnailFromIcon(Album *album, const QPixmap& thumbnail);
     void slotThumbnailLost(Album *album);


More information about the Digikam-devel mailing list