mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-26 08:01:32 +08:00
Change to support loading of older files without UserVersion atribute
This commit is contained in:
parent
8b6df4aaa5
commit
f58a3d4401
@ -251,11 +251,16 @@ bool DockManagerPrivate::restoreStateFromXml(const QByteArray &state, int versi
|
|||||||
}
|
}
|
||||||
|
|
||||||
ADS_PRINT(s.attributes().value("UserVersion"));
|
ADS_PRINT(s.attributes().value("UserVersion"));
|
||||||
|
// Older files do not support UserVersion but we still want to load them so
|
||||||
|
// we first test if the attribiute exists
|
||||||
|
if (!s.attributes().value("UserVersion").isEmpty())
|
||||||
|
{
|
||||||
v = s.attributes().value("UserVersion").toInt(&ok);
|
v = s.attributes().value("UserVersion").toInt(&ok);
|
||||||
if (!ok || v != version)
|
if (!ok || v != version)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
s.setFileVersion(v);
|
s.setFileVersion(v);
|
||||||
bool Result = true;
|
bool Result = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user