Summary: | Moving a trashed file to the trash and undoing makes the file disappear | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | kde.aerospace405 |
Component: | Trash | Assignee: | KIO Bugs <kio-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | akselmo, kdelibs-bugs, kfm-devel |
Priority: | NOR | ||
Version: | git master | ||
Target Milestone: | --- | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/frameworks/kio/-/commit/98a77e4905ea1d7a0cdf427bc1cc254a5d971c5a | Version Fixed In: | |
Sentry Crash Report: |
Description
kde.aerospace405
2024-12-12 20:47:33 UTC
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 |