Bug 98189

Summary: Adjusting time and date of exif does not take effect until properties are seen
Product: [Applications] digikam Reporter: Cedric Pradalier <cedric.pradalier>
Component: Metadata-DateAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles
Priority: NOR    
Version: 0.7.2   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In: 7.5.0
Sentry Crash Report:

Description Cedric Pradalier 2005-01-30 11:30:24 UTC
Version:           0.7.2-cvs (using KDE 3.3.1,  (3.1))
Compiler:          gcc version 3.3.5 (Debian 1:3.3.5-2)
OS:                Linux (ppc) release 2.6.8-powerpc

When using ajdust time and date dialog, and choosing "use exif time", the time is not updated in the property popup, until you click on the property button to have a look at the exif info.

After that, the time is ok in the property popup, but this does not have an effect on the ordering (if using date ordering). You have to change folder in order to reorder the photos.
Comment 1 Renchi Raju 2005-01-31 20:22:09 UTC
CVS commit by pahlibar: 


hold the file dates separately from the kfileitems and on refresh, reread the
file dates and resort the items.
BUG: 98189


  M +29 -0     albumiconview.cpp   1.107
  M +4 -0      kipiinterface.cpp   1.19


--- kdeextragear-3/digikam/digikam/albumiconview.cpp  #1.106:1.107
@@ -40,4 +40,5 @@
 #include <qdatetime.h>
 #include <qfileinfo.h>
+#include <qfile.h>
 #include <qguardedptr.h>
 #include <qdragobject.h>
@@ -82,4 +83,11 @@
 #include <libkexif/kexifdata.h>
 
+extern "C"
+{
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+}
+
 // Local includes.
 
@@ -1494,4 +1502,22 @@ void AlbumIconView::refreshItems(const K
         return;
 
+    // we do two things here:
+    // 1. refresh the timestamp
+    // 2. refresh the thumbnails
+    
+    for (KURL::List::const_iterator it = urlList.begin();
+         it != urlList.end(); ++it)
+    {
+        AlbumIconItem* iconItem = findItem((*it).url());
+        if (!iconItem)
+            continue;
+
+        struct stat st;
+        if (::stat(QFile::encodeName((*it).path()), &st) == 0)
+        {
+            iconItem->time_ = st.st_mtime;
+        }
+    }
+    
     if (d->thumbJob.isNull())
     {
@@ -1516,4 +1542,7 @@ void AlbumIconView::refreshItems(const K
         d->thumbJob->addItems(urlList);
     }
+
+    // trigger a delayed update, in case we need to resort items
+    triggerUpdate();
 }
 

--- kdeextragear-3/digikam/digikam/kipiinterface.cpp  #1.18:1.19
@@ -175,4 +175,8 @@ void DigikamImageInfo::setTime(const QDa
                     << endl;
     }
+    else
+    {
+        AlbumManager::instance()->refreshItemHandler( _url );
+    }
 }