SUMMARY Files in trash disappear after moving file in trash to trash and undoing. STEPS TO REPRODUCE 1. Send a file (filename.txt) to the trash. 2. Open trash in dolphin. 3. Hold shift and drag to an empty space inside the trash folder 4. File gets renamed to filename (1).txt 5. Press CTRL+Z 6. The files are gone! OBSERVED RESULT File is gone. EXPECTED RESULT File doesn't disappear. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Fedora Linux 41 KDE Plasma Version: 6.2.4 KDE Frameworks Version: 6.8.0 Qt Version: 6.8.0 ADDITIONAL INFORMATION
Quick note: the files are still in ~/.local/share/Trash, but you can't view them in the "Trash" folder.
Can confirm. Dragging the file when its inside trash folder causes something odd to happen. Super weird! dolphin 25.03.70 Operating System: Fedora Linux 41 KDE Plasma Version: 6.2.80 KDE Frameworks Version: 6.10.0 Qt Version: 6.8.1 Kernel Version: 6.12.4-200.fc41.x86_64 (64-bit) Graphics Platform: Wayland Processors: 12 × AMD Ryzen 5 3600 6-Core Processor Memory: 15,5 GiB of RAM Graphics Processor: AMD Radeon RX 6600
Did some more investigation on this. This happens because of `kio/src/widgets/dropjob.cpp:485` The problem is that when dragging a file inside trash:// folder, the `allItemsAreFromTrash` boolean doesn't stay true, because the filepath is not `trash://file.txt` but `file://~/.local/share/Trash/files/file.txt`. Both are same thing essentially, just different protocol. Moving this under KIO.
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1782
To add my own steps, very similar to the reporter 1. Send file to trash 2. Open trash folder in dolphin 3. Drag the file inside trash folder to any empty space inside the trash view 4. File gets renamed and weird
Git commit 98a77e4905ea1d7a0cdf427bc1cc254a5d971c5a by Méven Car, on behalf of Akseli Lahtinen. Committed on 16/01/2025 at 20:30. Pushed by meven into branch 'master'. dropjob: Check if file is already in trash during dropjob Previously we checked if file is already in trash during the dropjob, but only by using the scheme. We should also check using the xdg path, to make sure we are not moving the same file to same folder, causing it to rename and confusing users. This also adds unittest `shouldDropFromXdgTrashToTrash`. M +30 -0 autotests/dropjobtest.cpp M +18 -0 src/widgets/dropjob.cpp https://invent.kde.org/frameworks/kio/-/commit/98a77e4905ea1d7a0cdf427bc1cc254a5d971c5a