This ensures that the filename extension is always visible, and also is just a
nicer way to elide file and folder names in general.
BUG: 404955
FIXED-IN: 19.12.0
elvisangelaccio | |
GB_2 |
Dolphin | |
VDG |
This ensures that the filename extension is always visible, and also is just a
nicer way to elide file and folder names in general.
BUG: 404955
FIXED-IN: 19.12.0
Details view:
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Hmm, I don't know, I'm afraid this would make the filenames harder to recognize.
The file extension can always be guessed by looking at the file icon/preview. Advanced user could also add the Type column in detail view mode. And there is also the Information panel...
Also note that the file dialog uses right-elision as well, so that would need to be patched accordingly.
In my opinion, middle elision is actually more comprehensible for filenames than right-elision is. macOS Finder also uses middle elision here, for comparison.
I'll do the file dialogs as well for consistency.
Right-sided elision isn't all that useful considering the filename that's being elided is usually pretty long already. This patch, however, would enable the user to always see the extension (which is a huge deal, especially if we're dealing with something malicious).
So +1 from me (will you be doing file dialogs in a separate patch or as part of this one?)
We would need a custom elideText function to solve https://bugs.kde.org/show_bug.cgi?id=404955
Original Qt function :
https://code.woboq.org/qt5/qtbase/src/gui/text/qtextengine.cpp.html#_ZNK11QTextEngine10elidedTextEN2Qt13TextElideModeERK6QFixediii
With
MyverylongFileName.txt
Currently we end up with Qt::ElideMiddle:
Myveryl....Name.txt
What we want I guess is : Qt::ElideLeft, keeping file extension.
MyverylongFil....txt
A function wrapping m_customizedFontMetrics.elidedText(text, Qt::ElideMiddle, availableTextWidth) while excluding file extension.