Skip to content

A set of small refactorings to the resource system

Dmitry Kazakov requested to merge dkazakov/krita:wt-refactorings into master

I have collected the refactorings that I left till after the embedded resources MR is merged. They do not change any behavior, just a do cleanups.

You can check them in a per-commit basis, because commits are independent.

  1. Refactor-out the usage of QBuffer with dummy QByteArray

    In quite a lot of places we use outdated QBuffer's API, where we create a QByteArray jsut for the sake of passing it into QBuffer. The current QBuffer's API creates an internal byte array internally in the default constructor.

    (That is not something life-critical, I just felt itchy when saw that everywhere =) )

  2. Simplify interface of KoResourceLoadResult

    The patch adds a resource() method that can return a typed resource right away. This is basically a copy of QVariant's value() API.

  3. Remove KisKraLoader::Resource

    It can now be replaced with KoResourceSignature

  4. Don't look for dependent resources in KisAllResourcesModel::resourcesForFilename

    Firstly, this feature is never used in the current code (the corresponding argument is always false). Secondly, this search loads all the resources known to Krita into memory, which is exactly what we tried to avoid with the resources redesign.

Merge request reports