Commit f59b38b7 authored by Adrian Page's avatar Adrian Page

Pass profile name by reference.

svn path=/trunk/koffice/; revision=690020
parent 480edf76
......@@ -31,7 +31,7 @@ public:
Chromaticities chromaticities;
};
KoLcmsRGBColorProfile::KoLcmsRGBColorProfile(const Chromaticities &chromaticities, double gamma, QString profileName)
KoLcmsRGBColorProfile::KoLcmsRGBColorProfile(const Chromaticities &chromaticities, double gamma, const QString &profileName)
: d(new Private())
{
const int numGammaTableEntries = 256;
......@@ -47,9 +47,10 @@ KoLcmsRGBColorProfile::KoLcmsRGBColorProfile(const Chromaticities &chromaticitie
cmsHPROFILE profile = cmsCreateRGBProfile(const_cast<cmsCIExyY *>(&chromaticities.whitePoint),
const_cast<cmsCIExyYTRIPLE *>(&chromaticities.primaries),
transferFunctions);
QString name = profileName;
if (profileName.isEmpty()) {
profileName = QString("lcms virtual RGB profile - R(%1, %2) G(%3, %4) B(%5, %6) W(%7, %8) gamma %9")
if (name.isEmpty()) {
name = QString("lcms virtual RGB profile - R(%1, %2) G(%3, %4) B(%5, %6) W(%7, %8) gamma %9")
.arg(chromaticities.primaries.Red.x)
.arg(chromaticities.primaries.Red.y)
.arg(chromaticities.primaries.Green.x)
......@@ -63,9 +64,9 @@ KoLcmsRGBColorProfile::KoLcmsRGBColorProfile(const Chromaticities &chromaticitie
// icSigProfileDescriptionTag is the compulsory tag and is the profile name
// displayed by other applications.
cmsAddTag(profile, icSigProfileDescriptionTag, profileName.toLatin1().data());
cmsAddTag(profile, icSigProfileDescriptionTag, name.toLatin1().data());
cmsAddTag(profile, icSigDeviceModelDescTag, profileName.toLatin1().data());
cmsAddTag(profile, icSigDeviceModelDescTag, name.toLatin1().data());
// Clear the default manufacturer's tag that is set to "(lcms internal)"
QByteArray ba("");
......
......@@ -45,7 +45,7 @@ public:
* @param gamma gamma value for the red, green and blue transfer functions
* @param name the profile name
*/
KoLcmsRGBColorProfile(const Chromaticities &chromaticities, double gamma, QString name = QString());
KoLcmsRGBColorProfile(const Chromaticities &chromaticities, double gamma, const QString &name = QString());
/**
* Destructor.
......
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