Version: v0.8.3 (using KDE 3.1.0) Installed from: Gentoo Compiler: gcc version 3.2.1 OS: Linux (i686) release 2.4.20 when I download files from FTP they always have the current time as timestamp. I think it would be better that KGet after downloading and closing the file would set the timestamp to the original timestamp that the file has on the ftp server.
This could be an option. I will put this on the KGet2 TODO list.
Created attachment 78195 [details] Stat the FTP file after transfer to get mtime I was taking a look at this bug and drafted this patch for the traditional KIO plugin. If this looks acceptable I can take on this bug and implement something similar in the rest of the plugins that need it.
Hey! It seems fine to me, in case there is no other way to get this data from ftp, which would use the original get job... Also, to remove the boost dependency we could use: struct utimbuf time; time.modtime = modTime.toTime_t(); time.actime = QDateTime::currentDateTime().toTime_t(); utime(file.toUtf8().data(), &time); Lukas
(In reply to comment #3) > Hey! > > It seems fine to me, in case there is no other way to get this data from > ftp, which would use the original get job... Looked for that all night and found nothing; I'll take a look again today. That may actually be a good addition for KIO, I'm not sure how easy it is to implement with the current code though. > Also, to remove the boost dependency we could use: > struct utimbuf time; > time.modtime = modTime.toTime_t(); > time.actime = QDateTime::currentDateTime().toTime_t(); > utime(file.toUtf8().data(), &time); Heh, I actually tried to avoid the code above by using Boost (since it is already used by qPGPMe). Anyhow, your call! So for MultiSegmentKio, would this work? My concern is that all mirrors may not have the same mtime, can that happen?
:D Well to me the boost code looked more complicated to me than the utime call. :) Yes that can definitely happen, think about mirrors of ISOs which copy from each other. Lukas
Git commit abb4133360dddbe8f49ca318ec977e3db15ea448 by David E. Narvaez. Committed on 26/01/2014 at 23:06. Pushed by narvaez into branch 'master'. Set mtime When Transfering From FTP Added code to spawn a stat job from MultisegmentKio and Kio transfer plugins, which are the two plugins that handle FTP transfers. FIXED-IN: 4.13 REVIEW: 115319 M +28 -1 transfer-plugins/kio/transferKio.cpp M +1 -0 transfer-plugins/kio/transferKio.h M +26 -1 transfer-plugins/multisegmentkio/transfermultisegkio.cpp M +1 -0 transfer-plugins/multisegmentkio/transfermultisegkio.h http://commits.kde.org/kget/abb4133360dddbe8f49ca318ec977e3db15ea448