Qt: Fix fast forward crashing when no game loaded

This commit is contained in:
Vicki Pfau 2017-09-25 00:12:20 -07:00
parent 883e7729f4
commit 17e5b6a455
1 changed files with 6 additions and 2 deletions

View File

@ -1167,9 +1167,13 @@ void Window::setupMenu(QMenuBar* menubar) {
emulationMenu->addSeparator(); emulationMenu->addSeparator();
m_shortcutController->addFunctions(emulationMenu, [this]() { m_shortcutController->addFunctions(emulationMenu, [this]() {
if (m_controller) {
m_controller->setFastForward(true); m_controller->setFastForward(true);
}
}, [this]() { }, [this]() {
if (m_controller) {
m_controller->setFastForward(false); m_controller->setFastForward(false);
}
}, QKeySequence(Qt::Key_Tab), tr("Fast forward (held)"), "holdFastForward"); }, QKeySequence(Qt::Key_Tab), tr("Fast forward (held)"), "holdFastForward");
QAction* turbo = new QAction(tr("&Fast forward"), emulationMenu); QAction* turbo = new QAction(tr("&Fast forward"), emulationMenu);