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