Commit 6bacfcda authored by Wolthera van Hövell's avatar Wolthera van Hövell 🛍

Add attempt at saving color to xml.

This fails due to me not being able to load the xml, due object-bonanza.

ref T2337
parent 3bbf025b
...@@ -302,11 +302,12 @@ KisImageWSP KisKraLoader::loadXML(const KoXmlElement& element) ...@@ -302,11 +302,12 @@ KisImageWSP KisKraLoader::loadXML(const KoXmlElement& element)
} }
if(e.tagName()== PROOFINGWARNINGCOLOR) { if(e.tagName()== PROOFINGWARNINGCOLOR) {
if (e.hasAttribute("ColorData")) { qDebug()<<"Warning color found but can't be loaded because the loading code is incomplete, fixme!"
QByteArray colorData = QByteArray::fromBase64(e.attribute("ColorData").toLatin1()); //how do I convert a koxmlelement to a qdomelement???
KoColor color((const quint8*)colorData.data(), image->colorSpace()); //QDomElement eq = child.toElement();
proofingConfig->warningColor = color; //QString depth ="U8";
} //proofingConfig->warningColor = KoColor::fromXML(eq, depth, QHash<QString, QString>());
} }
if (e.tagName().toLower() == "animation") { if (e.tagName().toLower() == "animation") {
......
...@@ -296,8 +296,9 @@ void KisKraSaver::saveWarningColor(QDomDocument& doc, QDomElement& element, KisI ...@@ -296,8 +296,9 @@ void KisKraSaver::saveWarningColor(QDomDocument& doc, QDomElement& element, KisI
if (image->proofingConfiguration()) { if (image->proofingConfiguration()) {
QDomElement e = doc.createElement(PROOFINGWARNINGCOLOR); QDomElement e = doc.createElement(PROOFINGWARNINGCOLOR);
KoColor color = image->proofingConfiguration()->warningColor; KoColor color = image->proofingConfiguration()->warningColor;
QByteArray colorData = QByteArray::fromRawData((const char*)color.data(), color.colorSpace()->pixelSize()); color.toXML(doc, e);
e.setAttribute("ColorData", QString(colorData.toBase64())); //QByteArray colorData = QByteArray::fromRawData((const char*)color.data(), color.colorSpace()->pixelSize());
//e.setAttribute("ColorData", QString(colorData.toBase64()));
element.appendChild(e); element.appendChild(e);
} }
} }
......
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