Skip to content

459800 Fix inconsistencies in Create from Clipboard flow

In !1540 (merged), @rempt refactored the clipboard handling to reduce the overhead and number of generated previews. This MR, and the surrounding UX flow, had several shortcomings which are addressed here.

  • The main shortcoming was the improper handling of showEvent, which causes the flow to be made available even when the widget has specified there's no image available in the clipboard.
  • Even with that fixed, there's a slight delay involved in the preview generation. I've removed that timer, as its slot is actually part of the reason why the flow is not properly disabled.
  • Finally, I've made the code logic and flow consistent with the custom image widget, which will help prevent a previously documented race condition on KisDocument when creating the image.

This MR targets Krita 5.1 as that's where the bug was initially reported.

BUG: 459800

Test Plan

(Tell us how to test the changes you made.)

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

Loading