Bug 431638 - File Dialog does not add the proper extension automatically to saved files if the file name contains dots
Summary: File Dialog does not add the proper extension automatically to saved files if...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Open/save dialogs (show other bugs)
Version: 5.74.0
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2021-01-15 13:20 UTC by Jan Rathmann
Modified: 2021-03-08 13:15 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.81


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Rathmann 2021-01-15 13:20:21 UTC
SUMMARY
There are cases where the KDE File Save Dialog doesn't add the filename extension to saved files, even when "Automatically select filename extension" is checked. I discovered this during my mother's usage of LibreOffice on Kubuntu, but native KDE applications like Okular and Gwenview are also affected.

STEPS TO REPRODUCE
1. Start LibreOffice Writer with KDE integration.
2. Type in some random text.
3. Click on "Save.."
4. Verify that "Automatically select filename extension" is checked.
5. Enter a filename (without the extension) that contains at least one dot, e.g. a date specification like 15.01.2021
6. Click "Save".

OBSERVED RESULT
The saved file lacks the proper extension ("My Document 15.01.2021").

EXPECTED RESULT
The proper extension should have been added automatically to the filename ("My Document 15.01.2021.odt"), like it does when the filename contains no dot.

ADDITIONAL INFORMATION
From the KDE applications I did a test with Okular and Gwenview. Okular seems to behave the same way than LibreOffice, while Gwenview shows two error messages when testing with the steps described above:
"This type of image data is not supported" and "Saving of photo15.01 failed: This type of image data is not supported".
Obviously the part of the filename after the last dot is interpreted by the File Dialog/Gwenview as an attempt to manually specify an extension - a behaviour that doesn't make sense to me when the checkbox to automatically select the filename extension is checked.

There is a report in the LibreOffice Bugzilla about this problem, stating that this is a problem of the KDE File Dialog and it should be reported to KDE:
https://bugs.documentfoundation.org/show_bug.cgi?id=45764

This Krita bug seems to be related:
https://bugs.kde.org/show_bug.cgi?id=388738
(Beside this, I couldn't find any existing report.)

This bug has been an actual problem, since my mother (who is very much a non-technical person) sended files via mail that were erroneously saved without an extension and people were complaining that they couldn't open them because the lack of a proper extension. I had to teach her that she always has to keep in memory to manually add ".odt" to every document she saves in LO, which is not very convenient and can easily be forgotten.

Kind regards,
Jan

SOFTWARE/OS VERSIONS
Distro: Kubuntu 20.10 (and 20.04)
KDE Plasma Version: 5.19.5
KDE Frameworks Version: 5.74
Qt Version: 5.14.2
Comment 1 Nate Graham 2021-01-15 22:00:02 UTC
Can reproduce.
Comment 2 Nate Graham 2021-01-15 23:28:26 UTC
Investigating. The two-error-dialog Gwenview behavior seems specific to Gwenview's own code and is not in kio.
Comment 3 Nate Graham 2021-03-07 20:53:47 UTC
Fixed by Robert Hoffman with https://invent.kde.org/frameworks/kio/-/commit/75222ea5d076bec2ed907ffeb65eaa90a522a02a in Frameworks 5.81.
Comment 4 Jan Rathmann 2021-03-08 13:15:04 UTC
I have tested the fix and it seems to work well.
A big thank you to everyone involved! :-)