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++

Remove KisResourceLocator::initializeDb()

Dmitry Kazakovde351dde8437
diff --git a/libs/resources/KisResourceLocator.cpp b/libs/resources/KisResourceLocator.cpp
index e085013a43..3be4abb676 100644
--- a/libs/resources/KisResourceLocator.cpp
+++ b/libs/resources/KisResourceLocator.cpp
@@ -1023,40 +1023,9 @@ KisResourceLocator::LocatorError KisResourceLocator::firstTimeInstallation(Initi
f.write(KritaVersionWrapper::versionString().toUtf8());
f.close();
- if (!initializeDb()) {
- return LocatorError::CannotInitializeDb;
- }
-
return LocatorError::Ok;
}
-bool KisResourceLocator::initializeDb()
-{
- Q_EMIT progressMessage(i18n("Initializing the resources."));
- d->errorMessages.clear();
- findStorages();
-
- Q_FOREACH(auto loader, KisResourceLoaderRegistry::instance()->values()) {
- KisResourceCacheDb::registerResourceType(loader->resourceType());
- }
-
- Q_FOREACH(KisResourceStorageSP storage, d->storages) {
- if (!KisResourceCacheDb::addStorage(storage, (storage->type() == KisResourceStorage::StorageType::Folder ? false : true))) {
- d->errorMessages.append(QString("Could not add storage %1 to the cache database").arg(storage->location()));
- }
- }
-
- Q_FOREACH(KisResourceStorageSP storage, d->storages) {
- if (!KisResourceCacheDb::addStorageTags(storage)) {
- d->errorMessages.append(QString("Could not add tags for storage %1 to the cache database").arg(storage->location()));
- }
- }
-
- Q_EMIT storagesBulkSynchronizationFinished();
-
- return (d->errorMessages.isEmpty());
-}
-
void KisResourceLocator::findStorages()
{
d->storages.clear();
@@ -1198,6 +1167,8 @@ QString KisResourceLocator::makeStorageLocationAbsolute(QString storageLocation)
bool KisResourceLocator::synchronizeDb()
{
+ Q_EMIT progressMessage(i18n("Synchronizing the resources."));
+
d->errorMessages.clear();
// Add resource types that have been added since first-time installation.
diff --git a/libs/resources/KisResourceLocator.h b/libs/resources/KisResourceLocator.h
index 10270cd04f..e8cd0cfa8f 100644
--- a/libs/resources/KisResourceLocator.h
+++ b/libs/resources/KisResourceLocator.h
@@ -336,9 +336,6 @@ private:
LocatorError firstTimeInstallation(InitializationStatus initializationStatus, const QString &installationResourcesLocation);
- // First time installation
- bool initializeDb();
-
// Synchronize on restarting Krita to see whether the user has added any storages or resources to the resources location
bool synchronizeDb();