Skip to content

Commit f58a3d4

Browse files
Change to support loading of older files without UserVersion atribute
1 parent 8b6df4a commit f58a3d4

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/DockManager.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,15 @@ bool DockManagerPrivate::restoreStateFromXml(const QByteArray &state, int versi
251251
}
252252

253253
ADS_PRINT(s.attributes().value("UserVersion"));
254-
v = s.attributes().value("UserVersion").toInt(&ok);
255-
if (!ok || v != version)
254+
// Older files do not support UserVersion but we still want to load them so
255+
// we first test if the attribiute exists
256+
if (!s.attributes().value("UserVersion").isEmpty())
256257
{
257-
return false;
258+
v = s.attributes().value("UserVersion").toInt(&ok);
259+
if (!ok || v != version)
260+
{
261+
return false;
262+
}
258263
}
259264

260265
s.setFileVersion(v);

0 commit comments

Comments
 (0)