Merge pull request #7840 from jordan-woyak/game-config-save-fix

DolphinQt: Fix invalid error message when trying to save a zero-sized game config.
This commit is contained in:
Mat M 2019-03-03 02:27:12 -05:00 committed by GitHub
commit 7a8ddbaccb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -121,11 +121,14 @@ void GameConfigEdit::SaveFile()
QFile file(m_path);
if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text))
{
QMessageBox::warning(this, tr("Warning"), tr("Failed to open config file!"));
return;
}
const QByteArray contents = m_edit->toPlainText().toUtf8();
if (!file.write(contents))
if (file.write(contents) == -1)
QMessageBox::warning(this, tr("Warning"), tr("Failed to write config file!"));
}