Statesaving of color paints / mappings

This commit is contained in:
Tats
2014-01-23 22:01:21 -05:00
parent 9a9ba71eff
commit e91fe5d862
5 changed files with 135 additions and 7 deletions
+12
View File
@@ -78,6 +78,14 @@ void ProjectWriter::writeItem(Paint *item)
_xml.writeEndElement();
//_xml.writeEmptyElement("hello");
}
else if (item->getType() == "color")
{
// FIXME: check paint type before casting to Image
Color *color = (Color *) item;
_xml.writeTextElement("rgb", color->getColor().name());
_xml.writeEndElement();
}
else
qDebug() << "Unknown type, cannot save: " << item->getType() << endl;
}
@@ -128,6 +136,10 @@ void ProjectWriter::writeItem(Mapping *item)
_xml.writeEndElement(); // mapping
}
else if (item->getType().endsWith("_color"))
{
_xml.writeEndElement(); // mapping
}
else
qDebug() << "Unknown type, cannot save: " << item->getType() << endl;
}