From 4786911022e78dfdf513bcf2b43d68400d5c83fb Mon Sep 17 00:00:00 2001 From: xavierqet Date: Sun, 14 Oct 2007 21:38:27 +0000 Subject: [PATCH] Les conducteurs par defaut sont desormais sauvegardes dans les schemas git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@180 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- diagram.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/diagram.cpp b/diagram.cpp index 3bdc39d7f..3acbc1d0d 100644 --- a/diagram.cpp +++ b/diagram.cpp @@ -229,6 +229,11 @@ QDomDocument Diagram::toXml(bool diagram) { racine.setAttribute("colsize", border_and_inset.columnsWidth()); racine.setAttribute("height", border_and_inset.columnsHeight()); racine.setAttribute("version", QET::version); + + // type de conducteur par defaut + QDomElement default_conductor = document.createElement("defaultconductor"); + defaultConductorProperties.toXml(document, default_conductor); + racine.appendChild(default_conductor); } document.appendChild(racine); @@ -331,6 +336,15 @@ bool Diagram::fromXml(QDomDocument &document, QPointF position, bool consider_in // hauteur du schema double height = racine.attribute("height").toDouble(&ok); if (ok) border_and_inset.setColumnsHeight(height); + + // repere le permier element "defaultconductor" + for (QDomNode node = racine.firstChild() ; !node.isNull() ; node = node.nextSibling()) { + QDomElement elmts = node.toElement(); + if(elmts.isNull() || elmts.tagName() != "defaultconductor") continue; + defaultConductorProperties.fromXml(elmts); + break; + } + } // si la racine n'a pas d'enfant : le chargement est fini (schema vide)