Bug 493247 - Trash belonging to USB device is not updated when USB device is mounted/unmounted
Summary: Trash belonging to USB device is not updated when USB device is mounted/unmou...
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: git-master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-17 09:00 UTC by Akseli Lahtinen
Modified: 2024-09-17 13:03 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 24.12.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Akseli Lahtinen 2024-09-17 09:00:19 UTC
SUMMARY

When USB stick is inserted and a file inside of it is deleted, it will show in the trash:/ folder as expected.
However, after unmounting the USB stick, the file is still in the trash:/ folder, despite being actually located inside the USB stick's .Trash-1000 folder.

STEPS TO REPRODUCE
1. Connect usb stick
2. Delete a file on it
3. Disconnect usb stick

OBSERVED RESULT
Dolphin trash folder shows the file, even it's on the sticks .Trash-1000 folder. Restarting Dolphin will update the folder accordingly.

EXPECTED RESULT
Dolphin trash folder would not show the file until USB stick is reconnected.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 40
KDE Plasma Version: 6.1.90
KDE Frameworks Version: 6.7.0
Qt Version: 6.7.2
Kernel Version: 6.10.9-200.fc40.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
Comment 1 Méven 2024-09-17 09:28:54 UTC
Git commit 7af7159b35d6c3091eb73f34ead80d64b3f85e2b by Méven Car, on behalf of Akseli Lahtinen.
Committed on 17/09/2024 at 09:28.
Pushed by meven into branch 'master'.

dolphintrash.cpp: Update trash dir on device changes

Make sure we update the trash directory when storage devices are added/changed.
This ensures that whenever a mounted device, for example
USB stick is mounted/unmounted, the contents are properly
updated in the trash folder as well.

Otherwise the trash folder and USB stick trash folder will get
out of sync, making the trash folder behavior unpredictable.

M  +23   -0    src/trash/dolphintrash.cpp

https://invent.kde.org/system/dolphin/-/commit/7af7159b35d6c3091eb73f34ead80d64b3f85e2b