<table><tr><td style="">elvisangelaccio created this revision.<br />elvisangelaccio added a reviewer: dfaure.<br />Restricted Application added a project: Frameworks.<br />Restricted Application added a subscriber: Frameworks.<br />elvisangelaccio requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D10312" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>After a CopyJob the FileUndoManager records the file that was copied.<br />
If this file is deleted before the Undo operation is triggered, the<br />
File UndoManager will still try to undo the copy by deleting it.</p>

<p>This patch fixes this issue by validating the recorded files with<br />
<tt style="background: #ebebeb; font-size: 13px;">QFileInfo::exists()</tt>. If the FileUndoManager realizes that is no longer<br />
possible to undo the CopyJob, it will signal that undo operation is<br />
not available anymore.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>From Dolphin:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">Copy foo.txt to bar.txt</li>
<li class="remarkup-list-item">Shift+Del bar.txt</li>
<li class="remarkup-list-item">CTRL+Z</li>
</ul></div></div><br /><div><strong>REPOSITORY</strong><div><div>R241 KIO</div></div></div><br /><div><strong>BRANCH</strong><div><div>undo-deleted-file (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D10312" rel="noreferrer">https://phabricator.kde.org/D10312</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>autotests/fileundomanagertest.cpp<br />
autotests/fileundomanagertest.h<br />
src/widgets/fileundomanager.cpp</div></div></div><br /><div><strong>To: </strong>elvisangelaccio, dfaure<br /><strong>Cc: </strong>Frameworks, michaelh, ngraham<br /></div>