all repos — mgba @ dde155d0dd6e991291afed758e6eb1e54584443b

mGBA Game Boy Advance Emulator

Qt: Fix patch loading in a way that works in Qt pre-5.4
Vicki Pfau vi@endrift.com
Sat, 08 Jul 2017 15:33:08 -0700
commit

dde155d0dd6e991291afed758e6eb1e54584443b

parent

ecc4d6ee03fa5df3ad5a3b45b635b684e1d87cc6

1 files changed, 4 insertions(+), 12 deletions(-)

jump to
M src/platform/qt/GameController.cppsrc/platform/qt/GameController.cpp

@@ -126,7 +126,6 @@

if (controller->m_multiplayer) { controller->m_multiplayer->detachGame(controller); } - controller->m_patch = QString(); controller->clearOverride(); controller->endVideoLog();

@@ -474,6 +473,7 @@ if (patch) {

m_threadContext.core->loadPatch(m_threadContext.core, patch); } patch->close(patch); + m_patch = QString(); } else { mCoreAutoloadPatch(m_threadContext.core); }

@@ -543,18 +543,10 @@ mCoreLoadFile(m_threadContext.core, m_fname.toLocal8Bit().constData());

} void GameController::loadPatch(const QString& path) { - if (isLoaded()) { - closeGame(); - } + m_patch = path; if (m_gameOpen) { - QTimer::singleShot(10, this, [this, path]() { - loadPatch(path); - if (!m_gameOpen) { - openGame(); - } - }); - } else { - m_patch = path; + closeGame(); + openGame(); } }