diff --git a/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/dis_mag_term_2f-1.elmt b/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/dis_mag_term_2f-1.elmt index 174c2e9ff..8603640e0 100644 --- a/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/dis_mag_term_2f-1.elmt +++ b/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/dis_mag_term_2f-1.elmt @@ -1,4 +1,4 @@ - + Motorový spouštěč 1P+N @@ -12,6 +12,9 @@ قاطع مغناطيسي-حراري GV Motorvédő kapcsoló 1 pólusú GV + + protection + diff --git a/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/dis_mag_term_2f-2.elmt b/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/dis_mag_term_2f-2.elmt index 6581327df..29a32b89e 100644 --- a/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/dis_mag_term_2f-2.elmt +++ b/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/dis_mag_term_2f-2.elmt @@ -1,4 +1,4 @@ - + Disjoncteur Magnéto-thermique GV 2P @@ -8,6 +8,9 @@ Motorový spouštěč 2P Motorvédő kapcsoló 2 pólusú GV + + protection + diff --git a/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/dis_mag_term_4f-1.elmt b/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/dis_mag_term_4f-1.elmt index 593033011..e11eb4ba2 100644 --- a/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/dis_mag_term_4f-1.elmt +++ b/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/dis_mag_term_4f-1.elmt @@ -1,4 +1,4 @@ - + Motorschutzschalter @@ -12,6 +12,9 @@ قاطع مغناطيسي-حراري GV Motorvédő kapcsoló 3F + N pólusú + + protection + diff --git a/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/dis_mag_term_4f-2.elmt b/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/dis_mag_term_4f-2.elmt index 77a4eea7e..4dd91309e 100644 --- a/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/dis_mag_term_4f-2.elmt +++ b/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/dis_mag_term_4f-2.elmt @@ -1,4 +1,4 @@ - + Θερμομαγνητικό @@ -12,6 +12,9 @@ Motorschutzschalter Motorvédő kapcsoló 4 pólusú GV + + protection + diff --git a/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/fa4202_disjoncteur_moteur_3p.elmt b/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/fa4202_disjoncteur_moteur_3p.elmt index 6ffcddea4..16cb1596c 100644 --- a/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/fa4202_disjoncteur_moteur_3p.elmt +++ b/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/fa4202_disjoncteur_moteur_3p.elmt @@ -1,4 +1,4 @@ - + Motor circuit breaker Disyuntor termico magnetico 3P mando manual con auto retorno y boton de desenclave @@ -10,6 +10,9 @@ Wyłącznik silnikowy Motorvédő kapcsoló 3 pólusú + + protection + Author: The QElectroTech team License: see http://qelectrotech.org/wiki/doc/elements_license diff --git a/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/fa4213_disjoncteur_moteur_3p_n.elmt b/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/fa4213_disjoncteur_moteur_3p_n.elmt index 9459478e8..a328cb881 100644 --- a/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/fa4213_disjoncteur_moteur_3p_n.elmt +++ b/elements/10_electric/10_allpole/200_fuses&protective_gears/12_magneto_thermal_circuit_breakers/fa4213_disjoncteur_moteur_3p_n.elmt @@ -1,4 +1,4 @@ - + Motor circuit breaker with neutral Disyuntor termico magnetico 3P+N mando manual con auto retorno y boton de desenclave @@ -10,6 +10,9 @@ Wyłącznik silnikowy Motorvédő kapcsoló 3F + N pólusú + + protection + Author: The QElectroTech team License: see http://qelectrotech.org/wiki/doc/elements_license diff --git a/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff5.elmt b/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff5.elmt index b1b3495dc..78e8368a4 100644 --- a/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff5.elmt +++ b/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff5.elmt @@ -1,4 +1,4 @@ - + Disjoncteur differentiel 1P+N @@ -8,6 +8,9 @@ Jističochránič 2P Differenciál-védőkapcsoló 1P+N termikus és zárlatvédelemmel + + protection + diff --git a/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff6.elmt b/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff6.elmt index 58b3fa878..58d3fe413 100644 --- a/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff6.elmt +++ b/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff6.elmt @@ -1,4 +1,4 @@ - + Jističochránič 3P+N @@ -12,6 +12,9 @@ قاطع مغناطيسي-حراري GV Differenciál-védőkapcsoló 3P+N termikus és zárlatvédelemmel + + protection + diff --git a/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff7.elmt b/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff7.elmt index 0f4df1fa5..5808f6fdf 100644 --- a/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff7.elmt +++ b/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff7.elmt @@ -1,4 +1,4 @@ - + Disjoncteur differentiel 2P @@ -8,6 +8,9 @@ Jističochránič 2P Differenciál-védőkapcsoló 2P termikus és zárlatvédelemmel + + protection + diff --git a/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff8.elmt b/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff8.elmt index d23c36b3b..5d58a44d1 100644 --- a/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff8.elmt +++ b/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff8.elmt @@ -1,4 +1,4 @@ - + Jističochránič 3P @@ -12,6 +12,9 @@ قاطع مغناطيسي-حراري GV Differenciál-védőkapcsoló 3P termikus és zárlatvédelemmel + + protection + diff --git a/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff9.elmt b/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff9.elmt index 105c4886a..1dffdfe58 100644 --- a/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff9.elmt +++ b/elements/10_electric/10_allpole/200_fuses&protective_gears/50_residual_current_circuit_breaker/int_diff9.elmt @@ -1,4 +1,4 @@ - + Motorschutzschalter @@ -12,6 +12,9 @@ قاطع مغناطيسي-حراري GV Differenciál-védőkapcsoló 4P termikus és zárlatvédelemmel + + protection + diff --git a/sources/conductorproperties.cpp b/sources/conductorproperties.cpp index 2fe5edadd..846600a52 100644 --- a/sources/conductorproperties.cpp +++ b/sources/conductorproperties.cpp @@ -391,7 +391,6 @@ bool ConductorProperties::fromXml(const QDomElement &e) propertyDouble(e, "horizrotatetext", &horiz_rotate_text); QMetaEnum me = QMetaEnum::fromType(); - QString alinment_temp; if (propertyString(e, "horizontal-alignment", &alinment_temp) == PropertyFlags::Success) m_horizontal_alignment = Qt::Alignment(me.keyToValue(alinment_temp.toStdString().data())); diff --git a/sources/diagramevent/diagrameventaddelement.cpp b/sources/diagramevent/diagrameventaddelement.cpp index f73d38bd7..ebf2042c4 100644 --- a/sources/diagramevent/diagrameventaddelement.cpp +++ b/sources/diagramevent/diagrameventaddelement.cpp @@ -222,11 +222,6 @@ void DiagramEventAddElement::addElement() element -> setPos(m_element->pos()); element -> setRotation(m_element -> rotation()); m_diagram -> addItem(element); - - //The element is dropped by the user, the dynamic text field stored in m_converted_text_from_xml_description - //can be moved to m_dynamic_text_list, because we are sure fromXml will be not called. - element->m_dynamic_text_list.append(element->m_converted_text_from_xml_description.keys()); - element->m_converted_text_from_xml_description.clear(); QUndoCommand *undo_object = new QUndoCommand(tr("Ajouter %1").arg(element->name())); new AddGraphicsObjectCommand(element, m_diagram, m_element -> pos(), undo_object); diff --git a/sources/elementscollectioncache.cpp b/sources/elementscollectioncache.cpp index a72bb42e9..71f896d32 100644 --- a/sources/elementscollectioncache.cpp +++ b/sources/elementscollectioncache.cpp @@ -53,31 +53,6 @@ ElementsCollectionCache::ElementsCollectionCache(const QString &database_path, Q cache_db_.exec("PRAGMA synchronous = OFF"); #if TODO_LIST -#pragma message("@TODO This code remove old table with mtime for create table with uuid, created at version 0,5") -#endif - //TODO This code remove old table with mtime for create table with uuid, created at version 0,5 - //see to remove this code at version 0,6 or 0,7 when all users will table with uuid. -#if TODO_LIST -#pragma message("@TODO remove this code for qet 0.6 or later") -#endif - QSqlQuery table_name(cache_db_); - if (table_name.exec("PRAGMA table_info(names)")) - { - if (table_name.seek(2)) - { - QString str = table_name.value(1).toString(); - table_name.finish(); - if (str == "mtime") - { - QSqlQuery error; - error = cache_db_.exec("DROP TABLE names"); - error = cache_db_.exec("DROP TABLE pixmaps"); - } - } - else - table_name.finish(); - } -#if TODO_LIST #pragma message("@TODO the tables could already exist, handle that case.") #endif //@TODO the tables could already exist, handle that case. diff --git a/sources/qetgraphicsitem/element.cpp b/sources/qetgraphicsitem/element.cpp index 10c62b815..404f4f935 100644 --- a/sources/qetgraphicsitem/element.cpp +++ b/sources/qetgraphicsitem/element.cpp @@ -626,7 +626,7 @@ bool Element::parseInput(const QDomElement &dom_element) QString::number(0)).toDouble()); transform.translate(p.x(), p.y()); deti->setPos(transform.map(pos)); - m_converted_text_from_xml_description.insert(deti, p); + m_dynamic_text_list.append(deti); return true; } } @@ -863,99 +863,6 @@ bool Element::fromXml( deti->fromXml(qde); } - //************************// - //***Element texts item***// - //************************// - QList inputs = QET::findInDomElement(e, "inputs", "input"); // inputs in diagram section - - //First case, we check for the text item converted to dynamic text item - const QList conv_deti_list = - m_converted_text_from_xml_description.keys(); - QList successfully_converted; - const QList dom_inputs = inputs; - - for (DynamicElementTextItem *deti : conv_deti_list) - { - for(const QDomElement& dom_input : dom_inputs) - { - //we use the same method used in ElementTextItem::fromXml - //to compar and know if the input dom element is for one of the text stored. - //The comparaison is made from the text position : - //if the position of the text is the same as the position stored in 'input' dom element - //that mean this is the good text - if (qFuzzyCompare(qreal(dom_input.attribute("x").toDouble()), - m_converted_text_from_xml_description.value(deti).x()) && - qFuzzyCompare(qreal(dom_input.attribute("y").toDouble()), - m_converted_text_from_xml_description.value(deti).y())) - { - //Once again this 'if', is only for retrocompatibility with old old old project - //when element text with tagg "label" is not null, but the element information "label" is. - if((deti->textFrom() == DynamicElementTextItem::ElementInfo) - && (deti->infoName() == "label")) - m_data.m_informations.addValue( - "label", - dom_input.attribute("text")); - - deti->setText(dom_input.attribute("text")); - - qreal rotation = deti->rotation(); - QPointF xml_pos = m_converted_text_from_xml_description.value(deti); - - if (dom_input.attribute("userrotation").toDouble()) - rotation = dom_input.attribute("userrotation").toDouble(); - - if (dom_input.hasAttribute("userx")) - xml_pos.setX(dom_input.attribute("userx").toDouble()); - if(dom_input.hasAttribute("usery")) - xml_pos.setY(dom_input.attribute("usery", "0").toDouble()); - - //the origin transformation point of PartDynamicTextField - //is the top left corner, no matter the font size - //The origin transformation point of PartTextField - //is the middle of left edge, and so by definition, - //change with the size of the font - //We need to use a QTransform to find the pos of - //this text from the saved pos of text item - - deti->setPos(xml_pos); - deti->setRotation(rotation); - - QTransform transform; - //First make the rotation - transform.rotate(rotation); - QPointF pos = transform.map( - QPointF(0, - -deti->boundingRect().height()/2)); - transform.reset(); - //Second translate to the pos - transform.translate(xml_pos.x(), xml_pos.y()); - deti->setPos(transform.map(pos)); - - //dom_input and deti matched we remove - //the dom_input from inputs list, - //to avoid unnecessary checking made below - //we also move deti from the - //m_converted_text_from_xml_description to m_dynamic_text_list - inputs.removeAll(dom_input); - m_dynamic_text_list.append(deti); - m_converted_text_from_xml_description.remove(deti); - successfully_converted << deti; - } - } - } - - //###Firts case : if this is the first time the user open the project since text item are converted to dynamic text, - //in the previous opening of the project, every texts field present in the element description was created. - //At save time, the values of each of them was save in the 'input' dom element. - //The loop upper is made for the first case, to import the values in 'input' to the new converted dynamic texts field. - //###Second case : this is not the first time the user open the project since text item are converted to dynamic text. - //That mean, in a previous opening of the project, the text item was already converted and save as a dynamic text field. - //So there isn't 'input' dom element in the project, and every dynamic text item present in m_converted_text_from_xml_description - //need to be deleted (because already exist in m_dynamic_text_list, from a previous save) - for (DynamicElementTextItem *deti : m_converted_text_from_xml_description.keys()) - delete deti; - m_converted_text_from_xml_description.clear(); - for (QDomElement qde : QET::findInDomElement( e, "texts_groups", @@ -970,27 +877,6 @@ bool Element::fromXml( DiagramContext dc; dc.fromXml(e.firstChildElement("elementInformations"), "elementInformation"); - /* - * Since the commit 4791, the value used as "label" and "formula" - * is stored in differents keys (instead of the same key, - * "label" in previous version), so, if "label" contain "%" - * (Use variable value), and "formula" does not exist, - * this mean the label was made before commit 4791 (0.51 dev). - * So we swap the value stored in "label" to "formula" as expected. - * @TODO remove this code at version 0.7 or more (probably useless). - */ -#if TODO_LIST -#pragma message("@TODO remove this code for qet 0.7 or later") -#endif - if (dc["label"].toString().contains("%") - && dc["formula"].toString().isNull()) - { - dc.addValue("formula", dc["label"]); - } - //retrocompatibility with older version - if(dc.value("label").toString().isEmpty() && - !m_data.m_informations.value("label").toString().isEmpty()) - dc.addValue("label", m_data.m_informations.value("label")); //We must to block the update of the alignment when load the information //otherwise the pos of the text will not be the same as it was at save time. @@ -1000,181 +886,6 @@ bool Element::fromXml( for(DynamicElementTextItem *deti : m_dynamic_text_list) deti->m_block_alignment = false; - - /* During the devel of the version 0.7, - * the "old text" was replaced by the dynamic element text item. - * When open a project made befor the 0.7, - * we must to reproduce the same visual when - * the label are not empty and visible, - * and comment are not empty - * and visible and/or location are not empty and visible. - * we create a text group with inside the needed texts, - * label and comment and/or location. - */ - //#1 There must be old text converted to dynamic text - if(!successfully_converted.isEmpty()) - { - //#2 the element information must have label not empty and visible - //and a least comment or location not empty and visible - QString label = m_data.m_informations.value( - "label").toString(); - QString comment = m_data.m_informations.value( - "comment").toString(); - QString location = m_data.m_informations.value( - "location").toString(); - bool la = m_data.m_informations.keyMustShow("label"); - bool c = m_data.m_informations.keyMustShow("comment"); - bool lo = m_data.m_informations.keyMustShow("location"); - - if((m_link_type != Master) || - ((m_link_type == Master) && - (diagram()->project()->defaultXRefProperties( - m_kind_informations["type"].toString()).snapTo() - == XRefProperties::Label)) - ) - { - if(!label.isEmpty() && la && - ((!comment.isEmpty() && c) - || (!location.isEmpty() && lo))) - { - //#2 in the converted list one text must have text from = element info and info name = label - for(DynamicElementTextItem *deti - : successfully_converted) - { - if(deti->textFrom()== DynamicElementTextItem::ElementInfo - && deti->infoName() == "label") - { - qDebug() << "see 'Mod overlapping comparisons' in git"; - qreal rotation = deti->rotation(); - - //Create the comment item - DynamicElementTextItem *comment_text = nullptr; - if (m_link_type != PreviousReport - && m_link_type != NextReport) - { - m_state = QET::GIOK; - return(true); - } - if(!comment.isEmpty() && c) - { - comment_text = new DynamicElementTextItem(this); - comment_text->setTextFrom(DynamicElementTextItem::ElementInfo); - comment_text->setInfoName("comment"); - QFont font = comment_text->font(); - font.setPointSize(6); - comment_text->setFont(font); - comment_text->setFrame(true); - if(comment_text->toPlainText().count() > 17) - comment_text->setTextWidth(80); - comment_text->setPos(deti->x(), deti->y()+10); //+10 is arbitrary, comment_text must be below deti - addDynamicTextItem(comment_text); - } - //create the location item - DynamicElementTextItem *location_text = nullptr; - if (m_link_type != PreviousReport - && m_link_type != NextReport) - { - m_state = QET::GIOK; - return(true); - } - if(!location.isEmpty() && lo) - { - location_text = new DynamicElementTextItem(this); - location_text->setTextFrom(DynamicElementTextItem::ElementInfo); - location_text->setInfoName("location"); - QFont font = location_text->font(); - font.setPointSize(6); - location_text->setFont(font); - if(location_text->toPlainText().count() > 17) - location_text->setTextWidth(80); - location_text->setPos(deti->x(), deti->y()+20); //+20 is arbitrary, location_text must be below deti and comment - addDynamicTextItem(location_text); - } - - QPointF pos = deti->pos(); - if (m_link_type != PreviousReport - && m_link_type != NextReport) - { - m_state = QET::GIOK; - return(true); - } - //Create the group - ElementTextItemGroup *group = - addTextGroup(tr("Label + commentaire")); - addTextToGroup(deti, group); - if(comment_text) - addTextToGroup(comment_text, - group); - if(location_text) - addTextToGroup(location_text, - group); - group->setAlignment(Qt::AlignVCenter); - group->setVerticalAdjustment(-4); - group->setRotation(rotation); - //Change the position of the group, - //so that the text "label" stay in the same - //position in scene coordinate - group->setPos(pos - deti->pos()); - - break; - } - } - } - } - else - { - //This element is supposed to be a master and Xref property snap to bottom - if((!comment.isEmpty() && c) || (!location.isEmpty() && lo)) - { - //Create the comment item - DynamicElementTextItem *comment_text = nullptr; - if(!comment.isEmpty() && c) - { - comment_text = new DynamicElementTextItem(this); - comment_text - ->setTextFrom( - DynamicElementTextItem::ElementInfo); - comment_text->setInfoName("comment"); - QFont font = comment_text->font(); - font.setPointSize(6); - comment_text->setFont(font); - comment_text->setFrame(true); - comment_text->setTextWidth(80); - addDynamicTextItem(comment_text); - } - //create the location item - DynamicElementTextItem *location_text = nullptr; - if(!location.isEmpty() && lo) - { - location_text = new DynamicElementTextItem(this); - location_text - ->setTextFrom( - DynamicElementTextItem::ElementInfo); - location_text->setInfoName("location"); - QFont font = location_text->font(); - font.setPointSize(6); - location_text->setFont(font); - location_text->setTextWidth(80); - if(comment_text) - location_text->setPos( - comment_text->x(), - comment_text->y()+10); //+10 is arbitrary, location_text must be below the comment - addDynamicTextItem(location_text); - } - - //Create the group - ElementTextItemGroup *group = - addTextGroup(tr("Label + commentaire")); - if(comment_text) - addTextToGroup(comment_text, group); - if(location_text) - addTextToGroup(location_text, group); - group->setAlignment(Qt::AlignVCenter); - group->setVerticalAdjustment(-4); - group->setHoldToBottomPage(true); - } - } - } m_state = QET::GIOK; return(true); } diff --git a/sources/qetgraphicsitem/element.h b/sources/qetgraphicsitem/element.h index e433603a5..8f4a23d6c 100644 --- a/sources/qetgraphicsitem/element.h +++ b/sources/qetgraphicsitem/element.h @@ -196,18 +196,6 @@ class Element : public QetGraphicsItem // TODO: derive from propertiesInterface! void hoverLeaveEvent(QGraphicsSceneHoverEvent *) override; protected: - // m_converted_text_from_description, - // when a element is created from his description, - // the old element text item (tagged as 'input' in the xml) - // are converted to dynamic text field, - // the QPointF is the original position of the text item, - // because the origin transformation point of text item - // and dynamic text item are not the same, - // so we must to keep a track of this value, - // to be use in the function element::fromXml - QHash - m_converted_text_from_xml_description; - //ATTRIBUTES related to linked element QList connected_elements; QList tmp_uuids_link; diff --git a/sources/qetgraphicsitem/qetshapeitem.cpp b/sources/qetgraphicsitem/qetshapeitem.cpp index 0538c673f..30dc4a6a5 100644 --- a/sources/qetgraphicsitem/qetshapeitem.cpp +++ b/sources/qetgraphicsitem/qetshapeitem.cpp @@ -853,26 +853,8 @@ bool QetShapeItem::fromXml(const QDomElement &e) m_brush = QETXML::brushFromXml(e.firstChildElement("brush")); QString type = e.attribute("type"); -#if TODO_LIST -#pragma message("@TODO Compatibility for version older than N??4075, shape type was stored with an int") -#endif - //@TODO Compatibility for version older than N??4075, shape type was stored with an int - if (type.size() == 1) - { - switch(e.attribute("type","0").toInt()) - { - case 0: m_shapeType = Line; break; - case 1: m_shapeType = Rectangle; break; - case 2: m_shapeType = Ellipse; break; - case 3: m_shapeType = Polygon; break; - } - } - //For version after N??4075, shape is stored with a string - else - { - QMetaEnum me = metaObject()->enumerator(metaObject()->indexOfEnumerator("ShapeType")); - m_shapeType = QetShapeItem::ShapeType(me.keysToValue(type.toStdString().data())); - } + QMetaEnum me = metaObject()->enumerator(metaObject()->indexOfEnumerator("ShapeType")); + m_shapeType = QetShapeItem::ShapeType(me.keysToValue(type.toStdString().data())); if (m_shapeType != Polygon) {