SaveStates: Fix MainWindow.m_state_slot is not restored from Qt.ini Emulation/StateSlot.

Select slot 2 and exit & launch Dolphin again. Slot 2 is selected in the menu, but saving from selected slot saves to slot 1.
This commit is contained in:
Fabrice CARUSO 2023-09-25 17:18:56 +02:00 committed by Admiral H. Curtiss
parent f8445782bf
commit 2b2fd4217e
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
1 changed files with 3 additions and 0 deletions

View File

@ -280,6 +280,9 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters,
}
}
m_state_slot =
std::clamp(Settings::Instance().GetStateSlot(), 1, static_cast<int>(State::NUM_STATES));
QSettings& settings = Settings::GetQSettings();
restoreState(settings.value(QStringLiteral("mainwindow/state")).toByteArray());