Skip to content

Allow pasting from file manager clipboard list (Bug: 434619)

Ivan Yossi requested to merge ivany/krita:434619_FileManagerPaste into master

This is a small hack to see how the behaviour is seen. I have the feeling it makes no sense to paste from a filemanager since you are not copying image data, however most applications use the first file in the clipboard list to paste the image into the canvas, which can be convenient.

File managers copy clipboard result mimetype is text/uri-list, this patch loads the first file in the list only if is a compatible file format.

on macos any Finder clipboard has a qimage inside ( the mimetype icon) so this always pastes something

on linux clipboard is empty in case the copied file cannot be extracted to a qimage.

BUG:434619

Test Plan

Windows test missing

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
Edited by Ivan Yossi

Merge request reports

Loading