Fix check of open return code.

This commit is contained in:
Ernie Pasveer
2025-12-09 11:24:10 -06:00
parent e19846d44f
commit 45336a4da7
6 changed files with 23 additions and 10 deletions
+3 -3
View File
@@ -527,9 +527,9 @@ void SeerDebugDialog::loadProject (const QString& filename, bool notify) {
// Open the project file.
QFile loadFile(filename);;
loadFile.open(QIODevice::ReadOnly);
if (loadFile.error() != 0) {
bool f = loadFile.open(QIODevice::ReadOnly);
if (f == false) {
QMessageBox::critical(p, "Error", QString("Can't open the Seer project file '%1'.").arg(filename));
return;
}
@@ -537,7 +537,7 @@ void SeerDebugDialog::loadProject (const QString& filename, bool notify) {
// Populate the JSON document from the project file.
QJsonDocument jsonDoc = QJsonDocument::fromJson(loadFile.readAll());
bool f = loadJsonDoc(jsonDoc, filename);
f = loadJsonDoc(jsonDoc, filename);
if (f == false) {
return;
}