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
1 files changed,
4 insertions(+),
12 deletions(-)
M
src/platform/qt/GameController.cpp
→
src/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(); } }