fix terminal data problems

This commit is contained in:
Martin Marmsoler 2021-03-13 18:10:06 +01:00
parent c3c13d5102
commit 1dabe930f2

View File

@ -95,8 +95,8 @@ void TerminalData::fromSettings(QSettings &settings, const QString& prefix)
*/
void TerminalData::toXmlPriv(QDomElement& xml_element) const
{
xml_element.setAttribute("x", QString("%1").arg(q->scenePos().x()));
xml_element.setAttribute("y", QString("%1").arg(q->scenePos().y()));
xml_element.setAttribute("x", m_pos.x());
xml_element.setAttribute("y", m_pos.y());
if (!m_uuid.isNull())
xml_element.setAttribute("uuid", m_uuid.toString());
@ -164,6 +164,9 @@ bool TerminalData::valideXml(const QDomElement& xml_element) {
if (QETXML::propertyDouble(xml_element, "x"))
return false;
if (QETXML::propertyDouble(xml_element, "y"))
return false;
// Old projects do not have this property.
// if (QETXML::propertyString(xml_element, "type"))
// return false;