Bug 419069 - Wrong errorCode thrown when trying to recover deleted file
Summary: Wrong errorCode thrown when trying to recover deleted file
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.68.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-21 08:49 UTC by Xavi Rodriguez Gallego
Modified: 2020-06-21 20:24 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.72


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xavi Rodriguez Gallego 2020-03-21 08:49:50 UTC
SUMMARY
When a file is deleted (also from trash bin) and the user tries to recover it, KIO throws ERR_CANNOT_RENAME instead of ERR_DOES_NOT_EXIST.

STEPS TO REPRODUCE
1. Delete any file
2. Empty trash bin
3. Go to original folder and press Ctrl+Z

OBSERVED RESULT
Could not rename file %1

EXPECTED RESULT
The file or folder %1 does not exist

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma:
(available in About System)
KDE Plasma Version: 5.18.3
KDE Frameworks Version: 5.68.0
Qt Version: 5.14.1

ADDITIONAL INFORMATION
Comment 1 Ahmad Samir 2020-06-21 20:24:50 UTC
Git commit a34cd22e3206588938323865bc77cfdb52c407aa by Ahmad Samir.
Committed on 21/06/2020 at 15:25.
Pushed by dfaure into branch 'master'.

[Trash] Handle ENOENT error when renaming files

When the user deletes a file, empties the trash, then tries to undo the
deletion, the error message should state that the file does not exist.

Add unit test.
FIXED-IN: 5.72

M  +12   -0    src/ioslaves/trash/tests/testtrash.cpp
M  +1    -0    src/ioslaves/trash/tests/testtrash.h
M  +5    -0    src/ioslaves/trash/trashimpl.cpp

https://invent.kde.org/frameworks/kio/commit/a34cd22e3206588938323865bc77cfdb52c407aa