Refactor embedded resources to be embedded as binary blobs
Refactor embedded resources to be embedded as binary blobs
The patch does multiple things:
-
Introduces KoResourceLoadResult class that encapsulates the result of a linked/embedded resource load operation. It may be in three states:
- an existing resource has been found in the database
- a binary blob of the embedded resource has been fetched
- "link failed" --- the resource links to an unexisting resource, which has not embedded into the parent resource
-
Makes KoResource::linkedResources and KoResource::embededResources return the list of KoResourceLoadResult objects instead of actual resources
-
KisResourceLocator parses this list and imports the resources as binary blobs into the storage, therefore keeping resources' md5 unchanged
-
Implements KisResourceLocator::importResource and KisResourceLocator::exportResource that manipulates with binary blobs
-
KisDocument and KisResourceBundle now also use import/export API, so MD5 doesn't change on embedding the resources.
Ref T14946
PS: All the related unittests seem to pass with this patch applied :)