From a6144f794bc657524e0ab15402c22fb894a86f95 Mon Sep 17 00:00:00 2001 From: c0sxm0s Date: Thu, 17 Sep 2026 13:13:35 +0100 Subject: [PATCH] launcher: report cheat file save failures (#669) PatchesDialog::Save silently ignored QSaveFile failures, leaving the status label showing the old "Loaded N cheat(s)" text so the user could not tell that their selection was not saved. Report the failure in the status label and the log instead. --- src/launcher/src/patchesDialog.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/launcher/src/patchesDialog.cpp b/src/launcher/src/patchesDialog.cpp index 04618aa8a..f3c002787 100644 --- a/src/launcher/src/patchesDialog.cpp +++ b/src/launcher/src/patchesDialog.cpp @@ -3,6 +3,7 @@ #include "configuration.h" #include +#include #include #include #include @@ -129,8 +130,11 @@ void PatchesDialog::Save() { document.setObject(root); QSaveFile output(path); - if (output.open(QIODevice::WriteOnly) && output.write(document.toJson()) >= 0 && - output.commit()) { - m_status->setText(tr("Cheat selection saved.")); + if (!output.open(QIODevice::WriteOnly) || output.write(document.toJson()) < 0 || + !output.commit()) { + qWarning() << "Could not save cheat file:" << output.errorString(); + m_status->setText(tr("Could not save cheat file: %1").arg(output.errorString())); + return; } + m_status->setText(tr("Cheat selection saved.")); }