mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-11 00:29:11 +01:00
DolphinQt: Fix invalid error message when trying to save a zero-sized game config.
This commit is contained in:
parent
4e5702de0f
commit
2cec5d0a08
@ -121,11 +121,14 @@ void GameConfigEdit::SaveFile()
|
|||||||
QFile file(m_path);
|
QFile file(m_path);
|
||||||
|
|
||||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text))
|
if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text))
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Warning"), tr("Failed to open config file!"));
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const QByteArray contents = m_edit->toPlainText().toUtf8();
|
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!"));
|
QMessageBox::warning(this, tr("Warning"), tr("Failed to write config file!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user