Commit 21b29c9e authored by Halla Rempt's avatar Halla Rempt

Do not map the empty profile name to a profile named "Dummy profile"

"Dummy profile" is very descriptive, but if we map a request for a
colorspace with an empty profile name to a colorspace with a profile
named "Dummy profile" the mapping function gets all confused.
parent 56057861
......@@ -46,7 +46,7 @@ KoColorConversionSystem::KoColorConversionSystem() : d(new Private)
d->alphaNode->crossingCost = 1000000;
d->alphaNode->isInitialized = true;
d->alphaNode->isGray = true; // <- FIXME: it's a little bit hacky as alpha doesn't really have color information
d->graph[ NodeKey(d->alphaNode->modelId, d->alphaNode->depthId, "Dummy profile")] = d->alphaNode;
d->graph[ NodeKey(d->alphaNode->modelId, d->alphaNode->depthId, "")] = d->alphaNode;
Vertex* v = createVertex(d->alphaNode, d->alphaNode);
v->setFactoryFromSrc(new KoCopyColorConversionTransformationFactory(AlphaColorModelID.id(), Integer8BitsColorDepthID.id(), ""));
......
......@@ -344,10 +344,6 @@ const KoColorSpace * KoColorSpaceRegistry::colorSpace(const QString &csID, const
}
QWriteLocker l(&d->registrylock);
Q_ASSERT(cs->id() == csID);
Q_ASSERT(cs->profile()->name() == profileName);
d->csMap[idsToCacheName(cs->id(), cs->profile()->name())] = cs;
cs->d->deletability = OwnedByRegistryDoNotDelete;
dbgPigmentCSRegistry << "colorspace count: " << d->csMap.count()
<< ", adding name: " << idsToCacheName(cs->id(), cs->profile()->name())
<< "\n\tcsID" << csID
......@@ -355,6 +351,11 @@ const KoColorSpace * KoColorSpaceRegistry::colorSpace(const QString &csID, const
<< "\n\tcs->id()" << cs->id()
<< "\n\tcs->profile()->name()" << cs->profile()->name()
<< "\n\tpName" << pName;
Q_ASSERT(cs->id() == csID);
Q_ASSERT(cs->profile()->name() == profileName);
d->csMap[idsToCacheName(cs->id(), cs->profile()->name())] = cs;
cs->d->deletability = OwnedByRegistryDoNotDelete;
}
QReadLocker l(&d->registrylock);
......@@ -426,7 +427,7 @@ const KoColorSpace * KoColorSpaceRegistry::rgb8(const QString &profileName)
{
if (profileName.isEmpty()) {
if (!d->rgbU8sRGB) {
d->rgbU8sRGB = colorSpace(KoRgbU8ColorSpace::colorSpaceId(), profileName);
d->rgbU8sRGB = colorSpace(KoRgbU8ColorSpace::colorSpaceId(), "");
}
Q_ASSERT(d->rgbU8sRGB);
return d->rgbU8sRGB;
......@@ -438,7 +439,7 @@ const KoColorSpace * KoColorSpaceRegistry::rgb8(const KoColorProfile * profile)
{
if (profile == 0) {
if (!d->rgbU8sRGB) {
d->rgbU8sRGB = colorSpace(KoRgbU8ColorSpace::colorSpaceId(), profile);
d->rgbU8sRGB = colorSpace(KoRgbU8ColorSpace::colorSpaceId(), "");
}
Q_ASSERT(d->rgbU8sRGB);
return d->rgbU8sRGB;
......
......@@ -21,7 +21,7 @@
KoDummyColorProfile::KoDummyColorProfile()
{
setName("Dummy profile");
setName("");
}
KoDummyColorProfile::~KoDummyColorProfile()
......
......@@ -39,7 +39,7 @@ TestColorConversionSystem::TestColorConversionSystem()
}
}
}
listModels.append(ModelDepthProfile(AlphaColorModelID.id(), Integer8BitsColorDepthID.id(), "Dummy profile"));
listModels.append(ModelDepthProfile(AlphaColorModelID.id(), Integer8BitsColorDepthID.id(), ""));
}
void TestColorConversionSystem::testConnections()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment