|
Krita Source Code Documentation
|
#include <KisEmbeddedResourceStorageProxy.h>
Public Member Functions | |
| void | addResource (KoResourceSP resource) |
| KisResourcesInterfaceSP | detachedResourcesInterface () |
| KisEmbeddedResourceStorageProxy (const QString &storageLocation) | |
| KisResourcesInterfaceSP | resourcesInterface () |
When PSD is loaded into a temporary document, e.g. in a thumbnailer thread, we don't have access to the resources database. Therefore we need to load the embedded resources into a local storage
Definition at line 19 of file KisEmbeddedResourceStorageProxy.h.
| KisEmbeddedResourceStorageProxy::KisEmbeddedResourceStorageProxy | ( | const QString & | storageLocation | ) |
Definition at line 12 of file KisEmbeddedResourceStorageProxy.cpp.
References KisGlobalResourcesInterface::instance(), m_fallbackResourcesInterface, m_rootResourcesInterface, and m_storageLocation.
| void KisEmbeddedResourceStorageProxy::addResource | ( | KoResourceSP | resource | ) |
Definition at line 26 of file KisEmbeddedResourceStorageProxy.cpp.
References KisResourceModel::addResource(), ResourceType::Gradients, KIS_SAFE_ASSERT_RECOVER_NOOP, ResourceType::LayerStyles, m_fallbackResourcesInterface, m_gradientsModel, m_patternsModel, m_storageLocation, m_stylesModel, and ResourceType::Patterns.
| KisResourcesInterfaceSP KisEmbeddedResourceStorageProxy::detachedResourcesInterface | ( | ) |
Return the resources interface that contains a snapshot of all the resources that were added to the proxy by then. The returned interface will not be linked to the proxy anymore.
Use this interface for initializing layers styles or paintop preset, which you plan to add to the proxy as well. It will let you avoid cycling shared pointer links (and, therefore, memory leaks).
PS: When the document is not temporary and has an officially registered storage, then resourcesInterface() and detachedResourcesInterface() return the same interface, which is KisGlobalResourcesInterface.
Definition at line 53 of file KisEmbeddedResourceStorageProxy.cpp.
References m_fallbackResourcesInterface, and m_rootResourcesInterface.
| KisResourcesInterfaceSP KisEmbeddedResourceStorageProxy::resourcesInterface | ( | ) |
Returns the resources interface that lets you access all the embedded resources added to the proxy, either before this call, or after it.
Definition at line 48 of file KisEmbeddedResourceStorageProxy.cpp.
References m_rootResourcesInterface.
|
private |
Definition at line 48 of file KisEmbeddedResourceStorageProxy.h.
|
private |
Definition at line 53 of file KisEmbeddedResourceStorageProxy.h.
|
private |
Definition at line 52 of file KisEmbeddedResourceStorageProxy.h.
|
private |
Definition at line 49 of file KisEmbeddedResourceStorageProxy.h.
|
private |
Definition at line 47 of file KisEmbeddedResourceStorageProxy.h.
|
private |
Definition at line 51 of file KisEmbeddedResourceStorageProxy.h.