Skip to content

ToolHelper code cleanup

Paolo Amadini requested to merge paolo/krita:paolo/tool-helper-cleanup into master

The code already depends implicitly on some KoToolBase instances having the identifier assigned from KoToolFactoryBase, but all other factory properties need an indirect lookup.

This patch series makes this reference explicit, so we can document when the factory is relevant, simplify the KoToolManager code by removing the ToolHelper class, and remove several loops. These are 160 lines in total.

It would additionally be possible to make the factory, and thus the tool identifier, mandatory during the construction of KoToolBase, but this would be a bigger refactoring and not required right now. This would solve the current issue for which configuration widgets created during the tool construction don't have access to its identifier and use an empty one instead.

libs-ui-kis_animation_importer_test fails but it doesn't seem related to this patch at first glance.

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. (See above)
  • 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