diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-03-28 13:54:13 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2014-10-31 21:16:54 +0100 |
commit | 17e5b577b0a18d0612ddce3d8f26a09049b38a15 (patch) | |
tree | 0b409eb53bd40ee57feb44019de7494bdd1bf3e8 /src/widgets/widgets/qmainwindowlayout.cpp | |
parent | 6336ae831dcbe287e5aeeb73dc160bd067e63176 (diff) |
Cleanup: Remove some obsolete code supporting a pre-4.3 format
Loading a dock window state saved by a Qt 4.2 app is not
something we need to support anymore.
Change-Id: I9ee6e2c742b31114081852e7236cfc8696b9b270
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/widgets/widgets/qmainwindowlayout.cpp')
-rw-r--r-- | src/widgets/widgets/qmainwindowlayout.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index 43f168ecd8..1cc7f201ba 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -615,11 +615,8 @@ static QList<T> findChildrenHelper(const QObject *o) } //pre4.3 tests the format that was used before 4.3 -bool QMainWindowLayoutState::checkFormat(QDataStream &stream, bool pre43) +bool QMainWindowLayoutState::checkFormat(QDataStream &stream) { -#ifdef QT_NO_TOOLBAR - Q_UNUSED(pre43); -#endif while (!stream.atEnd()) { uchar marker; stream >> marker; @@ -630,8 +627,7 @@ bool QMainWindowLayoutState::checkFormat(QDataStream &stream, bool pre43) case QToolBarAreaLayout::ToolBarStateMarkerEx: { QList<QToolBar *> toolBars = findChildrenHelper<QToolBar*>(mainWindow); - if (!toolBarAreaLayout.restoreState(stream, toolBars, marker, - pre43 /*testing 4.3 format*/, true /*testing*/)) { + if (!toolBarAreaLayout.restoreState(stream, toolBars, marker, true /*testing*/)) { return false; } } @@ -672,14 +668,8 @@ bool QMainWindowLayoutState::restoreState(QDataStream &_stream, } QDataStream ds(copy); - const bool oldFormat = !checkFormat(ds, false); - if (oldFormat) { - //we should try with the old format - QDataStream ds2(copy); - if (!checkFormat(ds2, true)) { - return false; //format unknown - } - } + if (!checkFormat(ds)) + return false; QDataStream stream(copy); @@ -719,7 +709,7 @@ bool QMainWindowLayoutState::restoreState(QDataStream &_stream, case QToolBarAreaLayout::ToolBarStateMarkerEx: { QList<QToolBar *> toolBars = findChildrenHelper<QToolBar*>(mainWindow); - if (!toolBarAreaLayout.restoreState(stream, toolBars, marker, oldFormat)) + if (!toolBarAreaLayout.restoreState(stream, toolBars, marker)) return false; for (int i = 0; i < toolBars.size(); ++i) { |