Commit a0f194df authored by Jouni Pentikäinen's avatar Jouni Pentikäinen

Save per-assistant visibility

Saving the options in the View menu (show painting assistants, show
assistant previews) remain unimplemented. The flags are stored in the
decoration owned by the view, so they would either need to be serialized
with the view or refactored to be document-wide.

CCBUG: 382805
parent a4c92943
......@@ -330,6 +330,7 @@ QByteArray KisPaintingAssistant::saveXml(QMap<KisPaintingAssistantHandleSP, int>
xml.writeStartDocument();
xml.writeStartElement("assistant");
xml.writeAttribute("type",d->id);
xml.writeAttribute("active", QString::number(d->isSnappingActive));
xml.writeStartElement("handles");
Q_FOREACH (const KisPaintingAssistantHandleSP handle, d->handles) {
int id = handleMap.size();
......@@ -359,6 +360,11 @@ void KisPaintingAssistant::loadXml(KoStore* store, QMap<int, KisPaintingAssistan
while (!xml.atEnd()) {
switch (xml.readNext()) {
case QXmlStreamReader::StartElement:
if (xml.name() == "assistant") {
QStringRef active = xml.attributes().value("active");
d->isSnappingActive = (active != "0");
}
if (xml.name() == "handle") {
QString strId = xml.attributes().value("id").toString(),
strX = xml.attributes().value("x").toString(),
......
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