dfaure added inline comments.

INLINE COMMENTS

> file_unix.cpp:1074
>  
>      if (::rename(_src.data(), _dest.data())) {
>          if (auto err = execWithElevatedPrivilege(RENAME, {_src, _dest}, 
> errno)) {

Wouldn't it be enough to just call QFile::rename here?

The whole idea is: if QFile::rename is able to rename a file in all cases, 
including the a->A special case on FAT, then let's just delegate the renaming 
to QFile.

Then we don't need to have any special case in our code.

QFile::rename does not overwrite, though, so if the dest exists and the 
Overwrite flag is set, we might have to either delete the dest first (race 
condition, not sure it matters here), or in *that* case use ::rename() since we 
know it can't be a FAT32-case-change (FAT32 can't have both a and A).

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D29610

To: ahmadsamir, #frameworks, dfaure
Cc: kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns

Reply via email to