[Digikam-devel] [Bug 137993] importing photos into albums results in time/date file override with current one

Marcel Wiesweg marcel.wiesweg at gmx.de
Sat Dec 9 15:49:46 GMT 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=137993         
marcel.wiesweg gmx de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From marcel.wiesweg gmx de  2006-12-09 16:49 -------
SVN commit 611828 by mwiesweg:

Set modification date in digikamalbums::put.
Code copied from kdelibs/kioslave/file/file.cc

BUG: 137993


 M  +17 -0     digikamalbums.cpp  


--- trunk/extragear/graphics/digikam/kioslave/digikamalbums.cpp #611827:611828
 @ -457,6 +457,23  @
         }
     }
 
+    // set modification time
+    const QString mtimeStr = metaData( "modified" );
+    if ( !mtimeStr.isEmpty() ) {
+        QDateTime dt = QDateTime::fromString( mtimeStr, Qt::ISODate );
+        if ( dt.isValid() ) {
+            KDE_struct_stat dest_statbuf;
+            if (KDE_stat( _dest.data(), &dest_statbuf ) == 0) {
+                struct utimbuf utbuf;
+                utbuf.actime = dest_statbuf.st_atime; // access time, unchanged
+                utbuf.modtime = dt.toTime_t(); // modification time
+                kdDebug() << k_funcinfo << "setting modtime to " << utbuf.modtime << endl;
+                utime( _dest.data(), &utbuf );
+            }
+        }
+
+    }
+
     // First check if the file is already in database
     if (!findImage(album.id, url.fileName()))
     {



More information about the Digikam-devel mailing list