From 9bf1d61f4fc0825cf26f38526552ff0ba15771be Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 3 Oct 2020 01:23:04 +1000 Subject: [PATCH] Qt: Fix resume with a save state again --- src/duckstation-qt/qthostinterface.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/duckstation-qt/qthostinterface.cpp b/src/duckstation-qt/qthostinterface.cpp index c1b610f04..6fadd25ee 100644 --- a/src/duckstation-qt/qthostinterface.cpp +++ b/src/duckstation-qt/qthostinterface.cpp @@ -361,24 +361,23 @@ void QtHostInterface::resumeSystemFromState(const QString& filename, bool boot_o return; } - std::string state_filename = filename.toStdString(); - if (state_filename.empty()) - { - state_filename = GetMostRecentResumeSaveStatePath(); - if (state_filename.empty()) - { - emit errorReported(tr("No resume save state found.")); - return; - } - } - emit emulationStarting(); - ResumeSystemFromState(state_filename.c_str(), boot_on_failure); + if (filename.isEmpty()) + ResumeSystemFromMostRecentState(); + else + ResumeSystemFromState(filename.toStdString().c_str(), boot_on_failure); } void QtHostInterface::resumeSystemFromMostRecentState() { - resumeSystemFromState(QString(), false); + std::string state_filename = GetMostRecentResumeSaveStatePath(); + if (state_filename.empty()) + { + emit errorReported(tr("No resume save state found.")); + return; + } + + loadState(QString::fromStdString(state_filename)); } void QtHostInterface::onDisplayWindowKeyEvent(int key, bool pressed)