Do not update hotkey assignments on window close

If this commit is not applied, then the previous commit will cause hotkeys to be saved if there is a syntax error when hitting "OK" and the user presses the X to close the window.

This commit only applies changes to hotkey config if no syntax error occurs.
This commit is contained in:
sowens99 2021-09-27 14:29:34 -04:00
parent 242bce27a1
commit 556323561c

View File

@ -509,7 +509,6 @@ void IOWindow::OnDialogButtonPressed(QAbstractButton* button)
const auto lock = ControllerEmu::EmulatedController::GetStateLock();
UpdateExpression(m_expression_text->toPlainText().toStdString());
m_original_expression = m_reference->GetExpression();
if (ciface::ExpressionParser::ParseStatus::SyntaxError == m_reference->GetParseStatus())
{
@ -518,6 +517,7 @@ void IOWindow::OnDialogButtonPressed(QAbstractButton* button)
else
{
// must be the OK button
m_original_expression = m_reference->GetExpression();
accept();
}
}