Bug 444953

Summary: Dolphin cannot move file to trash if filename is too long: Clearer inline error message
Product: [Applications] dolphin Reporter: postix <postix>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: REPORTED ---    
Severity: wishlist CC: esperluette08, kfm-devel, me, postix
Priority: NOR Keywords: usability
Version: 21.08.2   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: The error message on top of Dolphin doesn't wrap

Description postix 2021-11-04 15:04:32 UTC
SUMMARY

I have downloaded a file, which unfortunately has a very long filename (246 chars), and it resides which is located at


`/home/me/ThisIsAFileNameWith246CharsInTotal_abcdefghijklmnopqrstuvwxyz_0123456789_abcdefghijklmnopqrstuvwxyz_0123456789_abcdefghijklmnopqrstuvwxyz_0123456789_abcdefghijklmnopqrstuvwxyz_0123456789_abcdefghijklmnopqrstuvwxyz_0123456789_0123456789_0123456789`

If I try to move the file to the trash in Dolphin it says

`"Could not write to file /home/me/.local/share/Trash/info/ThisIsAFileNameWith246CharsInTotal_abcdefghijklmnopqrstuvwxyz_0123456789_abcdefghijklmnopqrstuvwxyz_0123456789_abcdefghijklmnopqrstuvwxyz_0123456789_abcdefghijklmnopqrstuvwxyz_0123456789_abcdefghijklmnopqrstuvwxyz_0123456789_0123456789_0123456789.trashinfo."`


It would be convenient if Dolphin informed that the filename or total path is actually to long and that a direct deletion is possible. It may even offer it as a dialog choice to do so instead.


SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20211102
KDE Plasma Version: 5.23.2
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2
Kernel Version: 5.14.14-1-default (64-bit)
Comment 1 Jakub Kuczys 2023-02-15 11:48:27 UTC
I would like to suggest that this should be treated as a bug rather than a wishlist request. The FreeDesktop.org Trash specification explicitly doesn't require that the filename of the file in the Trash folder stays the same as info about the original name should instead be conveyed by the `Path`  field in the `.trashinfo` file. This is how, for example, trash-cli behaves - it truncates the filename if it's too long (and adds a suffix if necessary though that's probably already handled by Dolphin since it's needed when a file with the same name gets deleted multiple times).

[1] https://github.com/andreafrancia/trash-cli/blob/402999357ce32c0dfc945bcc161c020355950eb6/trashcli/put/info_dir.py#L19-L59
Comment 2 esperluette08 2023-05-14 01:08:22 UTC
Created attachment 158924 [details]
The error message on top of Dolphin doesn't wrap

Also, the error message doesn't wrap, so the Dolphin window cannot be resized before error message being closed.