Skip to content

Fix wrong resource selection on creation and import

Before this commit, the resource selected in the palette chooser wasn't always the same as the palette shown in the editor. This could cause the user to delete a different palette that they wanted if they didn't notice. It could also cause the palette to lose all the added colors when switching to the same palette.

Test Plan

Test 1A

  1. Create a palette
  2. Add some colors
  3. Open the palette chooser
  4. Switch to the same palette. (Before this MR, probably reset all colors?)

Test 1B

  1. Create a palette
  2. Add some colors
  3. Open the palette chooser
  4. Check which palette is selected (a wrong one before this MR).
  5. Press the delete button. See that the palette created in step 1 is still there and functioning normally, but some other palette got deleted.

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 Agata Cacko

Merge request reports