From f58a3d4401028679278fb0fde9219e444059e354 Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Wed, 3 Jun 2020 19:53:17 +0200 Subject: [PATCH 1/2] Change to support loading of older files without UserVersion atribute --- src/DockManager.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/DockManager.cpp b/src/DockManager.cpp index 1b8162f..d2a2a0b 100644 --- a/src/DockManager.cpp +++ b/src/DockManager.cpp @@ -251,10 +251,15 @@ bool DockManagerPrivate::restoreStateFromXml(const QByteArray &state, int versi } ADS_PRINT(s.attributes().value("UserVersion")); - v = s.attributes().value("UserVersion").toInt(&ok); - if (!ok || v != version) + // 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()) { - return false; + v = s.attributes().value("UserVersion").toInt(&ok); + if (!ok || v != version) + { + return false; + } } s.setFileVersion(v); From bcb711871028bb321f68d569e2b477b16b40138d Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Thu, 4 Jun 2020 20:48:59 +0200 Subject: [PATCH 2/2] Fixed typos --- src/DockManager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DockManager.cpp b/src/DockManager.cpp index d2a2a0b..5574f68 100644 --- a/src/DockManager.cpp +++ b/src/DockManager.cpp @@ -60,7 +60,7 @@ * name. Normally, when resources are built as part of the application, the * resources are loaded automatically at startup. The Q_INIT_RESOURCE() macro * is necessary on some platforms for resources stored in a static library. - * Because GCC caues a linker error if we put Q_INIT_RESOURCE into the + * Because GCC causes a linker error if we put Q_INIT_RESOURCE into the * loadStyleSheet() function, we place it into a function outside of the ads * namespace */ @@ -73,7 +73,7 @@ static void initResource() namespace ads { /** - * Internal file version in case the sturture changes interbally + * Internal file version in case the structure changes internally */ enum eStateFileVersion { @@ -252,7 +252,7 @@ bool DockManagerPrivate::restoreStateFromXml(const QByteArray &state, int versi 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 + // we first test if the attribute exists if (!s.attributes().value("UserVersion").isEmpty()) { v = s.attributes().value("UserVersion").toInt(&ok);