Bug 481532 - Deleting files from /tmp or /dev/shm (tmpfs), Dolphin will move them into /home (harddisk)
Summary: Deleting files from /tmp or /dev/shm (tmpfs), Dolphin will move them into /ho...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Trash (other bugs)
Version First Reported In: 5.103.0
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-19 06:29 UTC by red_Arti
Modified: 2025-11-27 10:44 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.21.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description red_Arti 2024-02-19 06:29:18 UTC
SUMMARY
I store some temporary work middle files in some tmpfs like `/dev/shm` or `/tmp`.
I use Dolphin to explore those paths.
Deleting files under those paths will move them into `/home/xxx/.local/share/Trash` .
I see folders (permission 700) `/tmp/.Trash-1000` and `/dev/shm/.Trash-1000` but Dolphin not using them.

`/home` is harddisk. `/tmp` or `/dev/shm` are in memory. Deleting files from memory should definitly NOT move them into harddisk

STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT
Deleting files from `/tmp` or `/dev/shm`, Dolphin moves them into  `/home/xxx/.local/share/Trash`

EXPECTED RESULT
Dolphin should move deleted files into `/tmp/.Trash-1000` or `/dev/shm/.Trash-1000`

SOFTWARE/OS VERSIONS
Operating System: openSUSE Leap 15.5
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 5.14.21-150500.55.44-default (64-bit)
Graphics Platform: X11


ADDITIONAL INFORMATION
In Dolphin settings dialog, I see "Trash" tab, which only shows:
- /home
- /media/xxA
- /media/xxB
...

no option for user to set trash path or modify the list.
Comment 1 red_Arti 2025-07-30 13:27:13 UTC
Please consider this: Add an option. Let user decide the behavior of trashing a file. Enable/Disable cross-disk trashing. 

Windows never move cross partition/disk/filesystem, when trashing files. I think that's the right way.
Comment 2 Antti Savolainen 2025-10-03 13:33:43 UTC
Likely a duplicate of 395023
Comment 3 Antti Savolainen 2025-10-03 13:37:54 UTC
bug 395023
Comment 4 Méven 2025-11-12 10:20:25 UTC
Git commit 0a63a9190642f9b7b8fd6252afffbf48f1a36165 by Méven Car, on behalf of Oliver Schramm.
Committed on 11/11/2025 at 10:59.
Pushed by meven into branch 'master'.

trash: don't fallback to home trash if trash is unavailable

If no trash can be created for the partition or network share, it might
not be desirable to move a file to the main trash on the home partition.
Especially when the partition is tmpfs (like /tmp), it would be
counterintuitive when the files would be persisted when it is "removed".
Even though this means, we can no longer test trash by using files
under /tmp.

So instead provide the user with a choice to delete the file
directly.
Related: bug 502315
Signed-off-by: Oliver Schramm <oliver.schramm97@gmail.com>

M  +3    -0    autotests/dropjobtest.cpp
M  +4    -1    src/core/askuseractioninterface.h
M  +2    -0    src/core/global.h
M  +3    -0    src/core/job_error.cpp
M  +107  -37   src/kioworkers/trash/tests/testtrash.cpp
M  +6    -8    src/kioworkers/trash/tests/testtrash.h
M  +21   -19   src/kioworkers/trash/trashimpl.cpp
M  +3    -1    src/kioworkers/trash/trashimpl.h
M  +3    -2    src/widgets/deleteortrashjob.cpp
M  +23   -0    src/widgets/widgetsaskuseractionhandler.cpp

https://invent.kde.org/frameworks/kio/-/commit/0a63a9190642f9b7b8fd6252afffbf48f1a36165