D29610: [CopyJob] Use stricter conditions when using QFile::rename in slotResultRenaming

David Faure noreply at phabricator.kde.org
Sun May 10 23:23:48 BST 2020


dfaure accepted this revision.
dfaure added a comment.
This revision is now accepted and ready to land.


  OK for now, to fix the unittests. The *real* fix however is to use QFile::rename in kio_file so that this failure to rename doesn't even happen in the first place.
  
  In this commit can you at least leave a TODO to that effect?

INLINE COMMENTS

> copyjob.cpp:1965
> +            if (_src != _dest
> +                && srcParentDir == destParentDir
> +                && QString::compare(_src, _dest, Qt::CaseInsensitive) == 0) {

Why this check? The next line compares absolute paths -- including the parent dir.

Hmm OK one could manufacture a special case with /dir/file and /DIR/FILE where the compare() passes but the parent dirs differ. The orig code had that bug... OK :)

REPOSITORY
  R241 KIO

BRANCH
  l-qfile-rename (branched from master)

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

To: ahmadsamir, #frameworks, dfaure
Cc: kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200510/d9e79e60/attachment.htm>


More information about the Kde-frameworks-devel mailing list