perform restartLayout conditionally (#4513)

* Revert "Fixed layout on Deck Editor not using last layout. It was reseting layout on ctor. (#4420)"

This reverts commit 3bc90003b3.

* restart layout on fresh installs
This commit is contained in:
ebbit1q 2022-01-08 22:03:53 +01:00 committed by GitHub
parent 26d1fcc944
commit 7903cd520a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -559,8 +559,13 @@ void TabDeckEditor::refreshShortcuts()
void TabDeckEditor::loadLayout()
{
LayoutsSettings &layouts = SettingsCache::instance().layouts();
restoreState(layouts.getDeckEditorLayoutState());
restoreGeometry(layouts.getDeckEditorGeometry());
auto &layoutState = layouts.getDeckEditorLayoutState();
if (layoutState.isNull()) {
restartLayout();
} else {
restoreState(layoutState);
restoreGeometry(layouts.getDeckEditorGeometry());
}
aCardInfoDockVisible->setChecked(cardInfoDock->isVisible());
aFilterDockVisible->setChecked(filterDock->isVisible());
@ -605,7 +610,7 @@ TabDeckEditor::TabDeckEditor(TabSupervisor *_tabSupervisor, QWidget *parent)
connect(&SettingsCache::instance().shortcuts(), SIGNAL(shortCutChanged()), this, SLOT(refreshShortcuts()));
refreshShortcuts();
QTimer::singleShot(0, this, SLOT(loadLayout()));
loadLayout();
}
TabDeckEditor::~TabDeckEditor()