Skip to content

Add import, rename and add functions with user input

Last talks with @lsegovia and @rempt made me realize that the logic in KisResourceModel (being one central place where all high level resource operations are done) is not enough because it doesn't handle user input. This MR contains an attempt to remove all special handling of resources in all resource types and delegate that logic to one central place.

Basically what it does is handling all the edge cases etc. so a developer making a new resource type would just need to call this function and everything would be handled automagically - error messages, asking the user for confirmation, etc.

PS. The class is right now not exactly best named so I will be fixing that. But it is located in resourcewidgets which I find appropriate.

Test Plan

Right now I only added it to sessions, palettes and to the Window -> Workspaces menu. I will replace all instances of addResource etc. functions from KisResourceModel (where appropriate, for example the ResourceImporter probably still needs to use addResource because it want to handle user input on its own) so that all resource types use the same logic.

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