forked from qt-creator/qt-creator
Debugger: Fix saving (legacy) state
Since dd9f9c799b we not only save the dock
widget state as the state of Perspectives, but the whole FancyMainwindow
state, so other properties from FancyMainWindow like the side bar state
is saved too.
The conversion from "legacy" to "new" state information was only done
when saving the state of perspectives when switching them (and for the
active Perspective at shutdown). The code that serialized that into
settings was expecting "new" state information, which was not true and
lead to soft asserts.
Do the conversion directly when reading settings instead.
Change-Id: I588fcf49bb7195100030266e5752358b7e734113
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -1078,15 +1078,13 @@ const char *PerspectiveState::savesHeaderKey()
|
||||
|
||||
bool PerspectiveState::hasWindowState() const
|
||||
{
|
||||
return !mainWindowState.isEmpty() || !mainWindowStateLegacy.isEmpty();
|
||||
return !mainWindowState.isEmpty();
|
||||
}
|
||||
|
||||
bool PerspectiveState::restoreWindowState(FancyMainWindow * mainWindow)
|
||||
{
|
||||
if (!mainWindowState.isEmpty())
|
||||
return mainWindow->restoreSettings(mainWindowState);
|
||||
if (!mainWindowStateLegacy.isEmpty())
|
||||
return mainWindow->restoreFancyState(mainWindowStateLegacy);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user