My home directory is setup with a number of symlinks and (systemd on-demand) sshfs mounts to allow working with both local and remote storage in an almost seamless fashion. Excellent stuff and i.m.h.o. a big selling point for the Linux desktop. One issue remaining though is the default delete action in Dolphin. Deleting a file in any other file system than the one trash resides in will result in everything being *copied* to the trash directory, then deleted from the other FS or remote location. Side note: Different BTRFS subvolumes will behave like this too, even when they are on the same FS. Some intelligence would need to be added to make this more workable. Maybe a canonical path based check to see which trash a set of deleted files belongs in? Reproducible: Always Steps to Reproduce: 1. In Dolphin, navigate to a different file system 2. Delete a (huge) file 3. See how the file is moved (copied/deleted) at disk copy speed. Actual Results: Lots of data moving around, increased SSD wear and power consumption. Expected Results: Use a local (w.r.t. the items being deleted) trash or ask the user to permanently delete the file.
Thanks for the bug report. This is not a Dolphin issue - you will see the same behavior if you use another way to move the files to the trash another way, like with Plasma's Folder View widget. I am not sure if/how it is possible at all to implement what you suggest and find a generic way to find a suitable trash directory for any given path.
Created attachment 94608 [details] Bash script to detect whether two paths/files are in the same file system
I've put together a small bash script as a proof of concept to show how the heuristics could function. Qt has a canonical path function which should be similar to the readlink utility I've used, from what I read in the online docs. The tool also shows the local mount point for the different file system.
I was not claiming that it is not possible to determine if two paths have the same mount point. However, even if you know that a given path does not have the same mount point as the user's home directory, it is not clear what a suitable trash directory would be. That's what I meant with my comment. But I have only very little knowledge of the Trash implementation, so I will shut up now ;-)
*** This bug has been marked as a duplicate of bug 76380 ***