mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-05-09 01:59:58 +02:00
Remove compatibility of QetShapItem from version prior to svn 4075
Befor svn 4075 QetShapItem was saved as int in xml, after as a string. Remove retro-compatibility (int to string) svn 4075 is older than 5 years.
This commit is contained in:
@@ -852,26 +852,8 @@ bool QetShapeItem::fromXml(const QDomElement &e)
|
|||||||
m_brush = QETXML::brushFromXml(e.firstChildElement("brush"));
|
m_brush = QETXML::brushFromXml(e.firstChildElement("brush"));
|
||||||
|
|
||||||
QString type = e.attribute("type");
|
QString type = e.attribute("type");
|
||||||
#if TODO_LIST
|
QMetaEnum me = metaObject()->enumerator(metaObject()->indexOfEnumerator("ShapeType"));
|
||||||
#pragma message("@TODO Compatibility for version older than N°4075, shape type was stored with an int")
|
m_shapeType = QetShapeItem::ShapeType(me.keysToValue(type.toStdString().data()));
|
||||||
#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()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_shapeType != Polygon)
|
if (m_shapeType != Polygon)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user