D10312: FileUndoManager: don't delete non-existing local files

Elvis Angelaccio noreply at phabricator.kde.org
Sun Feb 4 22:20:01 UTC 2018


elvisangelaccio created this revision.
elvisangelaccio added a reviewer: dfaure.
Restricted Application added a project: Frameworks.
Restricted Application added a subscriber: Frameworks.
elvisangelaccio requested review of this revision.

REVISION SUMMARY
  After a CopyJob the FileUndoManager records the file that was copied.
  If this file is deleted before the Undo operation is triggered, the
  File UndoManager will still try to undo the copy by deleting it.
  
  This patch fixes this issue by validating the recorded files with
  `QFileInfo::exists()`. If the FileUndoManager realizes that is no longer
  possible to undo the CopyJob, it will signal that undo operation is
  not available anymore.

TEST PLAN
  From Dolphin:
  
  - Copy foo.txt to bar.txt
  - Shift+Del bar.txt
  - CTRL+Z

REPOSITORY
  R241 KIO

BRANCH
  undo-deleted-file (branched from master)

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

AFFECTED FILES
  autotests/fileundomanagertest.cpp
  autotests/fileundomanagertest.h
  src/widgets/fileundomanager.cpp

To: elvisangelaccio, dfaure
Cc: #frameworks, michaelh, ngraham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180204/a4853501/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list