Skip to content

446120 446029 5.0 fixes

This MR extracts bits previously in !1177 (closed) that do respect string freeze, and adds a fix for another issue I found during testing. The commits here fix:

  • a regression in image positioning which was introduced in 47db9c0b (IS-446120); this caused the pasted image's position to be taken from the cursor at the paint device creation, instead of when the event was triggered
  • a discrepancy between local and remote image pasting, that would cause remote images to be pasted at the center without respecting the Shift modifier (also IS-446120)
  • drag-and-drop of remote images (Chrome < 95, Vivaldi, Edge) (IS-446029)
  • an inconsistency when dragging-and-dropping images to the welcome widget, that would cause IS-446029 on browsers that supply remote-only images (Chrome <96) and (conversely) successfully open them when a temporary file-backed copy is also supplied (Firefox). A further ward is added to ensure that drop events lacking an URL are explicitly rejected.

Additionally, I cherry-picked an enhancement from Tiar that is missing from 5.0, related to retrieval of translations on every build (it's changed to once a day).

Questions

  • The fix for IS-446120 prevents the selection menu from being triggered when invoked via Ctrl-Alt-V, instead only pasting the first URL.
    • Is this good enough?
    • Otherwise, do we need to reimplement the centering logic from KisPasteActionFactory::run into KisClipboardUtil::clipboardHasUrlsAction for the drop events?

Test Plan

Build Krita. Check that Ctrl+Alt+V and drag-and-drop result in the same position of the image.

Furthermore, check that all drag-and-drop events involving images from browsers result in a successful opening.

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 Amy spark

Merge request reports