From 578cda387b793d5ab86cae0efa9484eb196e4751 Mon Sep 17 00:00:00 2001 From: blacksun Date: Sun, 2 Mar 2014 11:15:59 +0000 Subject: [PATCH] Move load of kind information from element to custom element, because the kind information belong to the element definition, so custom element. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2896 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/qetgraphicsitem/customelement.cpp | 3 +++ sources/qetgraphicsitem/element.cpp | 10 ---------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/sources/qetgraphicsitem/customelement.cpp b/sources/qetgraphicsitem/customelement.cpp index f8ecf3327..ce8467d78 100644 --- a/sources/qetgraphicsitem/customelement.cpp +++ b/sources/qetgraphicsitem/customelement.cpp @@ -161,6 +161,9 @@ bool CustomElement::buildFromXml(const QDomElement &xml_def_elmt, int *state) { // extrait les noms de la definition XML names.fromXml(xml_def_elmt); setToolTip(name()); + + //load kind informations + kind_informations_.fromXml(xml_def_elmt.firstChildElement("kindInformations"), "kindInformation"); // parcours des enfants de la definition : parties du dessin int parsed_elements_count = 0; diff --git a/sources/qetgraphicsitem/element.cpp b/sources/qetgraphicsitem/element.cpp index 774af3881..6e4317098 100644 --- a/sources/qetgraphicsitem/element.cpp +++ b/sources/qetgraphicsitem/element.cpp @@ -398,8 +398,6 @@ bool Element::fromXml(QDomElement &e, QHash &table_id_adr, bool //load informations element_informations_.fromXml(e.firstChildElement("elementInformations"), "elementInformation"); - //load kind informations - kind_informations_.fromXml(e.firstChildElement("kindInformations"), "kindInformation"); // position, selection setPos(e.attribute("x").toDouble(), e.attribute("y").toDouble()); @@ -487,14 +485,6 @@ QDomElement Element::toXml(QDomDocument &document, QHash &table element.appendChild(infos); } - //save kind_informations of this element - if (! kind_informations_.keys().isEmpty()) { - QDomElement kind_infos = document.createElement("kindInformations"); - kind_informations_.toXml(kind_infos, "kindInformation"); - element.appendChild(kind_infos); - } - - return(element); }