Changeset View
Changeset View
Standalone View
Standalone View
plugins/color/lcms2engine/LcmsEnginePlugin.cpp
Show All 23 Lines | |||||
24 | 24 | | |||
25 | #include <QStringList> | 25 | #include <QStringList> | ||
26 | #include <QDir> | 26 | #include <QDir> | ||
27 | 27 | | |||
28 | #include <kpluginfactory.h> | 28 | #include <kpluginfactory.h> | ||
29 | #include <KoResourcePaths.h> | 29 | #include <KoResourcePaths.h> | ||
30 | #include <klocalizedstring.h> | 30 | #include <klocalizedstring.h> | ||
31 | #include <QDebug> | 31 | #include <QDebug> | ||
32 | #include <QApplication> | ||||
32 | 33 | | |||
33 | #include "kis_assert.h" | 34 | #include "kis_assert.h" | ||
34 | 35 | | |||
35 | #include <KoBasicHistogramProducers.h> | 36 | #include <KoBasicHistogramProducers.h> | ||
36 | #include <KoColorSpace.h> | 37 | #include <KoColorSpace.h> | ||
37 | #include <KoColorSpaceRegistry.h> | 38 | #include <KoColorSpaceRegistry.h> | ||
38 | #include <KoColorSpaceEngine.h> | 39 | #include <KoColorSpaceEngine.h> | ||
39 | 40 | | |||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | |||||
83 | K_PLUGIN_FACTORY_WITH_JSON(PluginFactory, "kolcmsengine.json", | 84 | K_PLUGIN_FACTORY_WITH_JSON(PluginFactory, "kolcmsengine.json", | ||
84 | registerPlugin<LcmsEnginePlugin>();) | 85 | registerPlugin<LcmsEnginePlugin>();) | ||
85 | 86 | | |||
86 | LcmsEnginePlugin::LcmsEnginePlugin(QObject *parent, const QVariantList &) | 87 | LcmsEnginePlugin::LcmsEnginePlugin(QObject *parent, const QVariantList &) | ||
87 | : QObject(parent) | 88 | : QObject(parent) | ||
88 | { | 89 | { | ||
89 | // We need all resource paths to be properly initialized via KisApplication, otherwise we will | 90 | // We need all resource paths to be properly initialized via KisApplication, otherwise we will | ||
90 | // initialize this instance with lacking color profiles which will cause lookup errors later on. | 91 | // initialize this instance with lacking color profiles which will cause lookup errors later on. | ||
91 | KoResourcePaths::assertReady(); | 92 | | ||
93 | KIS_ASSERT_X(KoResourcePaths::isReady() || | ||||
94 | (QApplication::instance()->applicationName() != "krita" && | ||||
95 | QApplication::instance()->applicationName() != "krita.exe"), | ||||
96 | "LcmsEnginePlugin::LcmsEnginePlugin", "Resource paths are not ready yet."); | ||||
97 | | ||||
92 | 98 | | |||
93 | // Set the lmcs error reporting function | 99 | // Set the lmcs error reporting function | ||
94 | cmsSetLogErrorHandler(&lcms2LogErrorHandlerFunction); | 100 | cmsSetLogErrorHandler(&lcms2LogErrorHandlerFunction); | ||
95 | 101 | | |||
96 | KoColorSpaceRegistry *registry = KoColorSpaceRegistry::instance(); | 102 | KoColorSpaceRegistry *registry = KoColorSpaceRegistry::instance(); | ||
97 | 103 | | |||
98 | // Initialise color engine | 104 | // Initialise color engine | ||
99 | KoColorSpaceEngineRegistry::instance()->add(new IccColorSpaceEngine); | 105 | KoColorSpaceEngineRegistry::instance()->add(new IccColorSpaceEngine); | ||
▲ Show 20 Lines • Show All 198 Lines • Show Last 20 Lines |