Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Move KoFontFamily updateThumbnail to resource iterator resourceImpl()

Wolthera van Hövell tot Westerflier4d33dfbb4533
diff --git a/libs/flake/resources/KoFontStorage.cpp b/libs/flake/resources/KoFontStorage.cpp
index c28cbbbc36..fb5616227e 100644
--- a/libs/flake/resources/KoFontStorage.cpp
+++ b/libs/flake/resources/KoFontStorage.cpp
@@ -79,6 +79,7 @@ public:
}
KoResourceSP resourceImpl() const override {
+ m_currentResource->updateThumbnail();
return m_currentResource;
}
private:
diff --git a/libs/resources/KisResourceCacheDb.cpp b/libs/resources/KisResourceCacheDb.cpp
index 8e8be7d731..ee2e39825a 100644
--- a/libs/resources/KisResourceCacheDb.cpp
+++ b/libs/resources/KisResourceCacheDb.cpp
@@ -1073,13 +1073,6 @@ bool KisResourceCacheDb::addResources(KisResourceStorageSP storage, QString reso
if (resource && resource->valid()) {
resource->setVersion(verIt->guessedVersion());
resource->setMD5Sum(storage->resourceMd5(verIt->url()));
- if (resourceType == ResourceType::FontFamilies) {
- // because the iterator shouldn't be updating the thumbnail, but we still need a thumbnail
- // before adding to the resource db, we're updating the thumbnail for font families here.
- // arguably we could replace this resource check by adding a "synthesized thumbnail" check,
- // so this could be generalized for other resources like layer styles.
- resource->updateThumbnail();
- }
if (resourceId < 0) {
if (addResource(storage, iter->lastModified(), resource, iter->type())) {