Bug 499348 - Pre-fill name field with filename extension for images created using pasted clipboard contents
Summary: Pre-fill name field with filename extension for images created using pasted c...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-31 00:17 UTC by Justin Zobel
Modified: 2025-03-28 08:45 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.13
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Zobel 2025-01-31 00:17:26 UTC
Today I learned a cool feature of Dolphin in that I can paste an image from my clipboard using Ctrl + V, and it will ask me for a filename and Data format, e.g. PNG.

However, when the file is created it is not given an extension, e.g. myimage.png. This is fine on Linux, as it uses metadata of the file to determine that it's a PNG. Windows and maybe other operating systems need a file extension to determine how to open it. So if I was to send this to a user that uses Windows, they would not be able to open it.
Comment 1 Bug Janitor Service 2025-03-02 01:19:11 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1819
Comment 2 Méven 2025-03-18 13:21:31 UTC Comment hidden (spam)
Comment 3 Bug Janitor Service 2025-03-18 13:49:18 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1841
Comment 4 Méven 2025-03-28 08:45:17 UTC
Git commit 6f3fcd48207abd73e7de880327d405373e17ac5b by Méven Car, on behalf of Nate Graham.
Committed on 28/03/2025 at 08:44.
Pushed by meven into branch 'master'.

PasteDialog: make MIME type handling fancier

If the default MIME type is valid, pre-fill the text field with the
appropriate filename extension and move the cursor before it (allowing
the user to start typing or replace the suggestion immediately, without
impacting the extension).

When the user changes the MIME type using the combobox, change the
file extension in the text field if possible.

To facilitate this, pre-existing code to generate fancy combobox labels
was moved into the private component so that it could easily access the
raw strings used to generate them.
FIXED-IN: 6.13

M  +1    -15   src/widgets/paste.cpp
M  +57   -2    src/widgets/pastedialog.cpp
M  +2    -1    src/widgets/pastedialog_p.h

https://invent.kde.org/frameworks/kio/-/commit/6f3fcd48207abd73e7de880327d405373e17ac5b