Bug 504071

Summary: When using SaveFile with "current_file" the extension is removed
Product: [Plasma] xdg-desktop-portal-kde Reporter: Colin Kinloch <colin>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: REPORTED ---    
Severity: normal CC: aleixpol, kde, nate
Priority: NOR    
Version First Reported In: 6.3.5   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Colin Kinloch 2025-05-11 18:29:38 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY

When using org.freedesktop.portal.FileChooser.SaveFile with "current_file" the extension is removed.

STEPS TO REPRODUCE
1. Use SaveFile with "current_folder" and "current_name" to save a file with an extension.
2. Use SaveFile with "current_file" to save over the previous file.
3. Notice that it is offering to save without the extension.

OBSERVED RESULT

The dialog resulting from SaveFile with "current_file" set fills the filename field without an extension.

EXPECTED RESULT

Either the filename field should have the extension of the value provided by "current_file" or the filter should automatically select the filter that matches the given extension.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: Fedora 42 using GNOME desktop with KDE portals.
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.9.0

ADDITIONAL INFORMATION

I found this while working on SDL: https://github.com/libsdl-org/SDL/pull/13007
I worked around it by setting the "current_filter" field.