Review Request 126659: [kio_ftp] fix display of file/directory modification time/date

Wolfgang Bauer wbauer at tmo.at
Thu Jan 7 12:21:33 UTC 2016



> On Jan. 7, 2016, 12:15 nachm., David Faure wrote:
> > src/ioslaves/ftp/ftp.cpp, line 1797
> > <https://git.reviewboard.kde.org/r/126659/diff/1/?file=428702#file428702line1797>
> >
> >     yes, this is a QDate behaviour change in Qt5.

According to the documentation, QDate's behaviour was the same in Qt4.
But kio_ftp didn't use QDate for this in kdelibs4... ;-)


> On Jan. 7, 2016, 12:15 nachm., David Faure wrote:
> > src/ioslaves/ftp/ftp.cpp, line 1775
> > <https://git.reviewboard.kde.org/r/126659/diff/1/?file=428702#file428702line1775>
> >
> >     The porting bug is here. In kdelibs4 tmptr was initialized to the current date, and used below.
> >     
> >     Now we have two variables, "int year" and "currentTime.year".
> >     
> >     To be closer to the orig code and to avoid risking that the day or month is still 0 as well, I would suggest to initialize year, day and month directly from currentTime, rather than to 0.
> >     
> >     I guess we can also remove the "currentTime.setTime(QTime(0,0,0)) because that's unused (right?)

> To be closer to the orig code and to avoid risking that the day or month is still 0 as well, I would suggest to initialize year, day and month directly from currentTime, rather than to 0.

Well, if we don't know the values, taking them from currentTime is likely just as wrong as setting them to 0.
But ok, I'll change it.

> I guess we can also remove the "currentTime.setTime(QTime(0,0,0)) because that's unused (right?)

Right, it is unused AFAICS.
Actually we could also just use QDate::currentDate() instead of QDateTime::currentDateTime() IMHO.


- Wolfgang


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126659/#review90743
-----------------------------------------------------------


On Jan. 7, 2016, 11 vorm., Wolfgang Bauer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126659/
> -----------------------------------------------------------
> 
> (Updated Jan. 7, 2016, 11 vorm.)
> 
> 
> Review request for KDE Frameworks, kdelibs and David Faure.
> 
> 
> Bugs: 354597
>     https://bugs.kde.org/show_bug.cgi?id=354597
> 
> 
> Repository: kio
> 
> 
> Description
> -------
> 
> - QDate() treats the year literally (i.e. 90 is really year 90, not 1990), so subtracting 1900 is wrong.
> - in the case when no year is mentioned in the server's reply (the year is implicit), it wasn't set to the current year, so the result was either 0 or -1.
> 
> 
> Diffs
> -----
> 
>   src/ioslaves/ftp/ftp.cpp 2179179 
> 
> Diff: https://git.reviewboard.kde.org/r/126659/diff/
> 
> 
> Testing
> -------
> 
> Connected to an FTP server with dolphin (15.12.0). The modification times/dates are now shown correctly.
> 
> 
> Thanks,
> 
> Wolfgang Bauer
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20160107/beffc950/attachment.html>


More information about the Kde-frameworks-devel mailing list