Qt: Fix patch loading in a way that works in Qt pre-5.4

This commit is contained in:
Vicki Pfau 2017-07-08 15:33:08 -07:00
parent ecc4d6ee03
commit dde155d0dd
1 changed files with 4 additions and 12 deletions

View File

@ -126,7 +126,6 @@ GameController::GameController(QObject* parent)
if (controller->m_multiplayer) { if (controller->m_multiplayer) {
controller->m_multiplayer->detachGame(controller); controller->m_multiplayer->detachGame(controller);
} }
controller->m_patch = QString();
controller->clearOverride(); controller->clearOverride();
controller->endVideoLog(); controller->endVideoLog();
@ -474,6 +473,7 @@ void GameController::openGame(bool biosOnly) {
m_threadContext.core->loadPatch(m_threadContext.core, patch); m_threadContext.core->loadPatch(m_threadContext.core, patch);
} }
patch->close(patch); patch->close(patch);
m_patch = QString();
} else { } else {
mCoreAutoloadPatch(m_threadContext.core); mCoreAutoloadPatch(m_threadContext.core);
} }
@ -543,18 +543,10 @@ void GameController::replaceGame(const QString& path) {
} }
void GameController::loadPatch(const QString& path) { void GameController::loadPatch(const QString& path) {
if (isLoaded()) {
closeGame();
}
if (m_gameOpen) {
QTimer::singleShot(10, this, [this, path]() {
loadPatch(path);
if (!m_gameOpen) {
openGame();
}
});
} else {
m_patch = path; m_patch = path;
if (m_gameOpen) {
closeGame();
openGame();
} }
} }