summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-09-04 15:14:06 +0200
committerFriedemann Kleint <Friedemann.Kleint@digia.com>2014-09-05 15:25:52 +0200
commit50e1733dfac8e0810a8a8aace7e9078322965167 (patch)
treeced1517dc43d994fca76fb9fb303f63ed69ad2a5 /src
parentf721a85b1e2a5c84a1a1a4d3f5b1c7fad7de854b (diff)
Bump version of QWidget geometry serialization to 2.0
It was decided not to port the handling of the saved screen size to Qt 4.8, so, bump the major version to ensure Qt 4.8 bails out. Task-number: QTBUG-38858 Change-Id: Ia870519553172cd383830d9a722b0fada180ee1b Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/kernel/qwidget.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 21278a0ba9..65978ef562 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -7213,9 +7213,9 @@ QByteArray QWidget::saveGeometry() const
const quint32 magicNumber = 0x1D9D0CB;
// Version history:
// - Qt 4.2 - 4.8.6, 5.0 - 5.3 : Version 1.0
- // - Qt 4.8.6 - today, 5.4 - today: Version 1.1, save screen width in addition to check for high DPI scaling.
- quint16 majorVersion = 1;
- quint16 minorVersion = 1;
+ // - Qt 4.8.6 - today, 5.4 - today: Version 2.0, save screen width in addition to check for high DPI scaling.
+ quint16 majorVersion = 2;
+ quint16 minorVersion = 0;
const int screenNumber = QApplication::desktop()->screenNumber(this);
stream << magicNumber
<< majorVersion
@@ -7270,13 +7270,13 @@ bool QWidget::restoreGeometry(const QByteArray &geometry)
if (storedMagicNumber != magicNumber)
return false;
- const quint16 currentMajorVersion = 1;
+ const quint16 currentMajorVersion = 2;
quint16 majorVersion = 0;
quint16 minorVersion = 0;
stream >> majorVersion >> minorVersion;
- if (majorVersion != currentMajorVersion)
+ if (majorVersion > currentMajorVersion)
return false;
// (Allow all minor versions.)
@@ -7293,7 +7293,7 @@ bool QWidget::restoreGeometry(const QByteArray &geometry)
>> maximized
>> fullScreen;
- if (majorVersion > 1 || minorVersion >= 1)
+ if (majorVersion > 1)
stream >> restoredScreenWidth;
const QDesktopWidget * const desktop = QApplication::desktop();