mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +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:
parent
1d2c00819d
commit
77710e1cc5
@ -852,26 +852,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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user