453247 455671 Paste fixes
As part of the refactor in MR !888 (merged), the logic that handled native (KisMimeData) pastes was removed in favour of a general clip handling. This had the side effect of erasing the paste's original position. This MR recovers the original code path and adds a defensive check in case the mimedata isn't ours.
Additionally, I tried to fix bug 455671 by treating new single-layer pastes the same as with Paste At Cursor or Paste into Active Layer -- namely, the same default name. Using the name of the original file isn't feasible because KisClipboard returns paint devices only.
In both cases, I'm not sure if this is the correct approach, so I'm open to feedback.
This MR partially reverts commit 84dc357b.
Test Plan
Build Krita. Open two images, select a portion of one, then paste on the other using "Paste into Active Layer".
The paste must match the position of the selection in the original.
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.
/cc @emmetoneill