Bug 467661 - Pasting an image into Dolphin, the "clipboard content" dialog should offer sane defaults
Summary: Pasting an image into Dolphin, the "clipboard content" dialog should offer sa...
Status: REPORTED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 23.03.80
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-21 19:49 UTC by Oded Arbel
Modified: 2023-05-13 00:00 UTC (History)
3 users (show)

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


Attachments
Dialogue box screenshot (24.87 KB, image/png)
2023-03-26 09:58 UTC, Ben Bonacci
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oded Arbel 2023-03-21 19:49:12 UTC
SUMMARY
When pasting an image from the clipboard into Dolphin, it pops up a dialog with a text box for typing in a filename and a drop down selection to choose a file type.

The defaults for this dialog are quite bad: the file name box is empty - without even a hint and no suggestion of a file extension; and the drop down menu is labeled "Data format" and the default value says "application/x-kde-onlyReplaceEmpty" (which I have no idea what it means and if I choose that it creates a 1 byte sized file).

The drop down already shows useful names for at least some of the mime-types that are offered in the clipboard content (Saying "PNG Image (image/png)" for example, compared to "image/epsi" for some other arbitrary content-type that few people know what it means).

STEPS TO REPRODUCE
1. Use Spectactle to take a screenshot and copy it directly to the clipboard instead of saving as a file.
2. Open Dolphin and navigate to some directory.
3. Hit CTRL+V

OBSERVED RESULT
A pop up dialog comes up, which is a bit confusing, and if typing some name and pressing ENTER, a useless file is created.

EXPECTED RESULT
A pop up dialog should come up with a suggested file name (for example: "Pasted content.png") and the format pull down should default to a useful selection (for example: PNG).

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: 5.27.80
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
I think it will also be useful if the format drop down will sort the suggestions so that the types whose meaning is recognized (i.e. showing a human readable name) are all sorted above all the alternative content-types that are not recognized. Also, when the user selects a different format, the file extension in the file name text box should change to match the selected format.
Comment 1 Ben Bonacci 2023-03-26 09:57:04 UTC
I believe part of this is related to bug 467513 as copying a screenshot from Spectacle to the clipboard appears as a broken entry, resulting in that application/x-kde-onlyReplaceEmpty file type.
As for the lack of a file extension, I agree that this should be included with a suggested filename by default.
Comment 2 Ben Bonacci 2023-03-26 09:58:40 UTC
Created attachment 157586 [details]
Dialogue box screenshot
Comment 3 Oded Arbel 2023-03-27 16:19:35 UTC
(In reply to Ben Bonacci from comment #1)
> I believe part of this is related to bug 467513 as copying a screenshot from
> Spectacle to the clipboard appears as a broken entry, resulting in that
> application/x-kde-onlyReplaceEmpty file type.

Maybe... I think in my case if the content type "x-kde-onlyReplaceEmpty" was offered, I could still choose "image/png" and get a PNG image, but I can't reproduce now because clicking "Copy" in Spectactle (or even Gwenview) now doesn't copy anything - not even a broken entry (I probably need to revert something or reboot or sth).

When there is nothing pastable in the clipboard, the "Paste" action is diabled in the Dolphin "Edit" menu and pressing CTRL+V doesn't do anything - which it might be a good idea to have the same behavior for the case of a clipboard entry with content type "application/x-kde-onlyReplaceEmpty" if it can be safely asserted that it means there's no valid content in the clipboard.