Version: digikam 0.7 (using KDE KDE 3.3.2) OS: Linux Copying images between two albums "destroys" (i.e. does not properly set) the file date of the copy. Since Digikam uses the file's modifications date to sort images by date instead of the EXIF date, the copied file's modification date should be set according to the original image.
CVS commit by pahlibar: when copying files over, set the file modification time to that of src file BUG: 99896 M +25 -0 digikamio.cpp 1.11 --- kdeextragear-3/digikam/kioslave/digikamio.cpp #1.10:1.11 @@ -45,4 +45,5 @@ extern "C" #include <sys/time.h> #include <time.h> +#include <utime.h> #include <errno.h> #include <sqlite.h> @@ -412,4 +413,16 @@ void kio_digikamioProtocol::copyInternal .arg(oldDirID) .arg(escapeString(src.fileName())) ); + + // also set the filetime to that of the original file + struct utimbuf t; + t.actime = buff_src.st_atime; + t.modtime = buff_src.st_mtime; + + if ( ::utime( _dest.data(), &t ) != 0 ) + { + kdWarning() << k_funcinfo + << "Failed to set datetime of destination file " + << "to that of of original file" << endl; + } } @@ -447,4 +460,16 @@ void kio_digikamioProtocol::copyInternal return; } + + // also set the filetime to that of the original file + struct utimbuf t; + t.actime = buff_src.st_atime; + t.modtime = buff_src.st_mtime; + + if ( ::utime( _dest.data(), &t ) != 0 ) + { + kdWarning() << k_funcinfo + << "Failed to set datetime of destination file " + << "to that of of original file" << endl; + } } }