From f26a4f897c5f6195fd60679a028c451870743094 Mon Sep 17 00:00:00 2001 From: Octol1ttle Date: Wed, 25 Feb 2026 16:44:30 +0500 Subject: [PATCH] fix ignoring return value of function declared with 'nodiscard' attribute Signed-off-by: Octol1ttle --- launcher/FileSystem.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/launcher/FileSystem.cpp b/launcher/FileSystem.cpp index 5c328c75f..b7125a162 100644 --- a/launcher/FileSystem.cpp +++ b/launcher/FileSystem.cpp @@ -953,7 +953,10 @@ QString createShortcut(QString destination, QString target, QStringList args, QS qWarning() << "Couldn't create directories within application"; return QString(); } - info.open(QIODevice::WriteOnly | QIODevice::Text); + if (!info.open(QIODevice::WriteOnly | QIODevice::Text)) { + qWarning() << "Failed to open file" << info.fileName() << "for writing!"; + return QString(); + } QFile(icon).rename(resources.path() + "/Icon.icns"); @@ -961,7 +964,10 @@ QString createShortcut(QString destination, QString target, QStringList args, QS QString exec = binaryDir.path() + "/Run.command"; QFile f(exec); - f.open(QIODevice::WriteOnly | QIODevice::Text); + if (!f.open(QIODevice::WriteOnly | QIODevice::Text)) { + qWarning() << "Failed to open file" << f.fileName() << "for writing!"; + return QString(); + } QTextStream stream(&f); auto argstring = quoteArgs(args, "\"", "\\\"");