all repos — mgba @ 55330698cb08493324a8be5e812e86f94e2ac1fe

mGBA Game Boy Advance Emulator

Qt: Fix fast forward crashing when no game is loaded
Vicki Pfau vi@endrift.com
Wed, 26 Jul 2017 10:57:04 -0700
commit

55330698cb08493324a8be5e812e86f94e2ac1fe

parent

56c6e3b497b45e59982f2cae19740d5fbe18bedc

1 files changed, 7 insertions(+), 2 deletions(-)

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

@@ -1163,6 +1163,7 @@ connect(turbo, &QAction::triggered, [this](bool value) {

m_controller->forceFastForward(value); }); addControlledAction(emulationMenu, turbo, "fastForward"); + m_gameActions.append(turbo); QMenu* ffspeedMenu = emulationMenu->addMenu(tr("Fast forward speed")); ConfigOption* ffspeed = m_config->addOption("fastForwardRatio");

@@ -1178,9 +1179,13 @@ }

m_config->updateOption("fastForwardRatio"); m_shortcutController->addFunctions(emulationMenu, [this]() { - m_controller->setRewinding(true); + if (m_controller) { + m_controller->setRewinding(true); + } }, [this]() { - m_controller->setRewinding(false); + if (m_controller) { + m_controller->setRewinding(false); + } }, QKeySequence("`"), tr("Rewind (held)"), "holdRewind"); QAction* rewind = new QAction(tr("Re&wind"), emulationMenu);