Change to support loading of older files without UserVersion atribute

This commit is contained in:
Uwe Kindler 2020-06-03 19:53:17 +02:00
parent 8b6df4aaa5
commit f58a3d4401

View File

@ -251,10 +251,15 @@ bool DockManagerPrivate::restoreStateFromXml(const QByteArray &state, int versi
} }
ADS_PRINT(s.attributes().value("UserVersion")); ADS_PRINT(s.attributes().value("UserVersion"));
v = s.attributes().value("UserVersion").toInt(&ok); // Older files do not support UserVersion but we still want to load them so
if (!ok || v != version) // we first test if the attribiute exists
if (!s.attributes().value("UserVersion").isEmpty())
{ {
return false; v = s.attributes().value("UserVersion").toInt(&ok);
if (!ok || v != version)
{
return false;
}
} }
s.setFileVersion(v); s.setFileVersion(v);