Review Request 111724: Port file kioslave rename() to QFile

David Faure faure at kde.org
Sat Jul 27 15:17:02 UTC 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/111724/#review36603
-----------------------------------------------------------


::rename also is only for files on the same partition, so that's not the issue. The problem is more likely the error handling, i.e. recognizing that the renaming failed because of that particular reason, and falling back (in libkio) to a copy followed by a delete (this only happens when the error code is ERROR_UNSUPPORTED_ACTION).

Anyway. I think we're making this more complex than it has to be. This is unix-only code, and it doesn't even have the largefile issues that other APIs have.
KDE_rename() is always ::rename(), on Unix, as can be seen in kde_file.h.

So I suggest to just use ::rename() instead of KDE_rename().

- David Faure


On July 26, 2013, 4:10 p.m., Martin Klapetek wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/111724/
> -----------------------------------------------------------
> 
> (Updated July 26, 2013, 4:10 p.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Description
> -------
> 
> Ports KDE_rename(..) to QFile::rename(..). All tests pass except those where moving dirs between partitions occur. The Qt4 docs says "rename will fail if newName and oldName are not on the same partition" for QDir::rename(); there's no such mention in Qt 5.dev docs but it still seems to be the case and I'm unsure what to do, please advise.
> 
> 
> Diffs
> -----
> 
>   kioslave/file/file_unix.cpp 64cffa0 
> 
> Diff: http://git.reviewboard.kde.org/r/111724/diff/
> 
> 
> Testing
> -------
> 
> All tests pass except moving dirs between partitions.
> 
> 
> Thanks,
> 
> Martin Klapetek
> 
>

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


More information about the Kde-frameworks-devel mailing list