Skip to content

Fix copy/paste frames to clipboard

Ivan Yossi requested to merge ivany/krita:404595_framesClipboard into master

I inadvertedly worked on the same bug as thie other merge request https://invent.kde.org/kde/krita/merge_requests/16 (two bugs open with descriptions very different :/ ) the difference is I used a reference uuid to find the source image to copy data from. Which in turn makes it not copy if the original source is closed. However it is very fast and works across multiple krita windows instances and types.

@ashwind fix is better in retaining data if original document is closed, but if the animation frames/file is too large it is slow on same image copy/paste/move frames operations. He expressed he might not be able to finish his patch, that's why I send this for review. However I still don't want to throw his work to waste.

Fixes bugs

BUG:408421 BUG:404595

What is done exactly

On save we use current image->root() node uuid to add to ClipboardMimeData On drop operation we look for the saved image->root() uuid in all open documents, if found we copy the frames data, else we KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE return false.

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.

Merge request reports