diff --git a/krita/main.cc b/krita/main.cc --- a/krita/main.cc +++ b/krita/main.cc @@ -99,6 +99,8 @@ qputenv("QT_QPA_PLATFORM", "xcb"); #endif + KoResourcePaths::setReady(false); // not ready yet + KisLoggingManager::initialize(); // A per-user unique string, without /, because QLocalServer cannot use names with a / in it diff --git a/libs/ui/KisApplication.cpp b/libs/ui/KisApplication.cpp --- a/libs/ui/KisApplication.cpp +++ b/libs/ui/KisApplication.cpp @@ -283,7 +283,7 @@ d.mkpath(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/symbols/"); // Indicate that it is now safe for users of KoResourcePaths to load resources - KoResourcePaths::setReady(); + KoResourcePaths::setReady(true); } void KisApplication::loadResources() diff --git a/libs/widgetutils/KoResourcePaths.h b/libs/widgetutils/KoResourcePaths.h --- a/libs/widgetutils/KoResourcePaths.h +++ b/libs/widgetutils/KoResourcePaths.h @@ -220,10 +220,10 @@ static QString locateLocal(const char *type, const QString &filename, bool createDir = false); /** - * Indicate that resource paths have been initialized and users + * Indicate if all resource paths have been initialized and users * of this class may expect to load resources from the proper paths. */ - static void setReady(); + static void setReady(bool ready); /** * Assert that all resource paths have been initialized. diff --git a/libs/widgetutils/KoResourcePaths.cpp b/libs/widgetutils/KoResourcePaths.cpp --- a/libs/widgetutils/KoResourcePaths.cpp +++ b/libs/widgetutils/KoResourcePaths.cpp @@ -141,7 +141,8 @@ QMutex relativesMutex; QMutex absolutesMutex; - bool ready = false; // Paths have been initialized + // Have paths have been initialized? Assume yes to run unit tests correctly. Krita's usual main() will initially set this to false. + bool ready = true; QStringList aliases(const QString &type) { @@ -553,9 +554,9 @@ return path + '/' + filename; } -void KoResourcePaths::setReady() +void KoResourcePaths::setReady(bool ready) { - s_instance->d->ready = true; + s_instance->d->ready = ready; } void KoResourcePaths::assertReady()