Bug 103458 - Thumbnail view not updated after changing comments
Summary: Thumbnail view not updated after changing comments
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Thumbs-Image (show other bugs)
Version: 0.7.2
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-07 23:17 UTC by Dik Takken
Modified: 2017-07-14 04:28 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dik Takken 2005-04-07 23:17:33 UTC
Version:           0.7.2 (using KDE KDE 3.3.2)
Installed from:    Gentoo Packages
OS:                Linux

When DigiKam is configured to display EXIF comments in the thumbnail view and the EXIF comments are edited, the thumbnail view does not refresh the changed comments.
Comment 1 Renchi Raju 2005-04-16 17:42:24 UTC
CVS commit by pahlibar: 



refresh the file metainfo if the user selects to save comments embedded in 
the file.
BUGS: 103458


  M +17 -0     albumiconitem.cpp   1.31
  M +1 -0      albumiconitem.h   1.10
  M +17 -10    imagedescedit.cpp   1.42


--- kdeextragear-3/digikam/digikam/albumiconitem.cpp  #1.30:1.31
@@ -151,4 +151,21 @@ void AlbumIconItem::setPixmap(const QPix
 }
 
+void AlbumIconItem::setMetaInfo(const KFileMetaInfo* metaInfo)
+{
+    if (metaInfo_)
+    {
+        delete metaInfo_;
+        metaInfo_ = 0;
+    }
+    metaInfo_  = metaInfo;
+
+    QRect r(view_->contentsX(), view_->contentsY(),
+            view_->visibleWidth(), view_->visibleHeight());
+    if (r.intersects(rect()))
+    {
+        repaint();
+    }
+}
+
 int AlbumIconItem::compare(ThumbItem *item)
 {

--- kdeextragear-3/digikam/digikam/albumiconitem.h  #1.9:1.10
@@ -68,4 +68,5 @@ public:
 
     void setPixmap(const QPixmap& thumb, const KFileMetaInfo* metaInfo);
+    void setMetaInfo(const KFileMetaInfo* metaInfo);
     QRect thumbnailRect() const;
 

--- kdeextragear-3/digikam/digikam/imagedescedit.cpp  #1.41:1.42
@@ -288,15 +288,22 @@ void ImageDescEdit::slotApply()
         {
             // store as JPEG Exif comment
-            KFileMetaInfo metaInfo(fileURL.path(), "image/jpeg", KFileMetaInfo::Fastest);
+            KFileMetaInfo*  metaInfo =
+                new KFileMetaInfo(fileURL.path(), "image/jpeg", KFileMetaInfo::Fastest);
 
             // set Jpeg comment
-             if (metaInfo.isValid () && metaInfo.mimeType() == "image/jpeg"
-                 && metaInfo.containsGroup("Jpeg EXIF Data"))
+             if (metaInfo->isValid () && metaInfo->mimeType() == "image/jpeg"
+                 && metaInfo->containsGroup("Jpeg EXIF Data"))
             {
                 kdDebug() << k_funcinfo << "Contains JPEG Exif data, setting comment"
                           << endl;
-                metaInfo["Jpeg EXIF Data"].item("Comment")
+                 (*metaInfo)["Jpeg EXIF Data"].item("Comment")
                     .setValue(m_commentsEdit->text());
-                metaInfo.applyChanges();
+                 metaInfo->applyChanges();
+                 m_currItem->setMetaInfo(metaInfo);
+             }
+             else
+             {
+                 delete metaInfo;
+                 metaInfo = 0;
             }