all repos — mgba @ de4b735409189c2038693faa1d02045d282bd3f5

mGBA Game Boy Advance Emulator

Qt: Fix patch loading while a game is running
Vicki Pfau vi@endrift.com
Sat, 08 Jul 2017 13:50:46 -0700
commit

de4b735409189c2038693faa1d02045d282bd3f5

parent

ed9fa2b118e7323774e29793c4e196e9eaa05ace

2 files changed, 10 insertions(+), 3 deletions(-)

jump to
M CHANGESCHANGES

@@ -168,6 +168,7 @@ - GB Video: Fix LYC regression

- Qt: Fix translation initialization (fixes mgba.io/i/776) - PSP2: Use custom localtime_r since newlib version is broken (fixes mgba.io/i/560) - GBA SIO: Improve SIO Normal dummy driver (fixes mgba.io/i/520) + - Qt: Fix patch loading while a game is running Misc: - Qt: Add language selector - GBA Timer: Improve accuracy of timers
M src/platform/qt/GameController.cppsrc/platform/qt/GameController.cpp

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

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