27 bool hasNext()
const override {
return false;}
113 QString
url()
const override
128 return fi.lastModified();
165 int indexOfUnderscore = url.lastIndexOf(
"_");
166 QString realUuid = url;
167 if (indexOfUnderscore >= 0) {
168 realUuid.remove(indexOfUnderscore, url.length() - indexOfUnderscore);
172 realUuid = QFileInfo(realUuid).baseName();
174 if (url.contains(
"pattern") || url.contains(
".pat")) {
177 if (patterns.contains(realUuid)) {
178 return patterns[realUuid];
182 QHash<QString, KisPSDLayerStyleSP> styles =
m_aslSerializer->stylesHash();
183 if (styles.contains(realUuid)) {
184 return styles[realUuid];
187 if (realUuid.startsWith(
"{")) {
188 realUuid = realUuid.right(realUuid.length() - 1);
190 if (realUuid.endsWith(
"}")) {
191 realUuid = realUuid.left(realUuid.length() - 1);
194 if (styles.contains(realUuid)) {
195 return styles[realUuid];
197 Q_FOREACH(QString ke, styles.keys()) {
229 warnKrita <<
"KisAslStorage::saveAsNewVersion is not implemented yet";
236 warnKrita <<
"Trying to add a null resource to KisAslStorage";
241 warnKrita <<
"Trying to add a resource that is not a layer style to KisAslStorage";
246 styles << layerStyle;
KIS_DECLARE_STATIC_INITIALIZER
QVector< KisPSDLayerStyleSP > m_styles
QScopedPointer< QHashIterator< QString, KoPatternSP > > m_patternsIterator
QHash< QString, KoPatternSP > m_patterns
KoResourceSP resourceImpl() const override
This only loads the resource when called (but not in case of asl...)
QScopedPointer< QVectorIterator< KisPSDLayerStyleSP > > m_stylesIterator
QString type() const override
QString url() const override
AslIterator(QSharedPointer< KisAslLayerStyleSerializer > aslSerializer, const QString &filename, const QString &resourceType)
QSharedPointer< KisAslLayerStyleSerializer > m_aslSerializer
KoResourceSP m_currentResource
QDateTime lastModified() const override
void next() override
The iterator is only valid if next() has been called at least once.
bool hasNext() const override
void next() override
The iterator is only valid if next() has been called at least once.
AslTagIterator(const QString &location, const QString &resourceType)
bool hasNext() const override
KisTagSP tag() const override
A tag object on which we can set properties and which we can save.
QSharedPointer< KisResourceStorage::ResourceIterator > resources(const QString &resourceType) override
QSharedPointer< KisResourceStorage::TagIterator > tags(const QString &resourceType) override
bool addResource(const QString &resourceType, KoResourceSP resource) override
bool loadVersionedResource(KoResourceSP resource) override
KisResourceStorage::ResourceItem resourceItem(const QString &url) override
KisAslStorage(const QString &location)
bool saveAsNewVersion(const QString &resourceType, KoResourceSP resource) override
bool supportsVersioning() const override
QSharedPointer< KisAslLayerStyleSerializer > m_aslSerializer
KoResourceSP resource(const QString &url) override
bool isValid() const override
void addStoragePluginFactory(KisResourceStorage::StorageType storageType, KisStoragePluginFactoryBase *factory)
static KisStoragePluginRegistry * instance()
const QString LayerStyles
The KisPSDLayerStyle class implements loading, saving and applying the PSD layer effects.
A resource item is simply an entry in the storage,.