Skip to content

Bug 413548 patch:prevent crash due to deletion of palette

This is a patch to bug #413548. The link to the bug is here. Whenever a palette was deleted or added in palette docker, the change didn't mirror in the comboBox next to Add to Palette of Tool Options of colorpicker tool until after a restart. Also there was a crash whenever the palette was deleted but remained in the comboBox and color was selected with Add to palette ON with the deleted palette selected. The KoResourceServerObserver class was used to observe changes in the palette resource server and combobox and the local QList of palettes were updated accordingly.

Test Plan

  • Choose colorpicker tool.
  • Toggle ON the Add to Palette box in the Tool Options.
  • Add new palette in the palette docker. This results in updation of comboBox.
  • Pick colours using colorpicker tool.
  • Delete the palette from palette docker.
  • The palette gets deleted from the comboBox as well.(Earlier it wouldn't get deleted and on adding color to the deleted palette a crush occured).

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 Saurabh Kumar

Merge request reports

Loading