mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 09:59:59 +03:00
Check return value of 'virtual bool QFile::open(QIODeviceBase::OpenMode)'
Signed-off-by: Dylan Schooner <dschooner05@gmail.com>
This commit is contained in:
parent
2982e6e7c9
commit
8d42bdaf6b
9 changed files with 63 additions and 28 deletions
|
|
@ -1002,7 +1002,10 @@ QString createShortcut(QString destination, QString target, QStringList args, QS
|
|||
if (!destination.endsWith(".desktop")) // in case of isFlatpak destination is already populated
|
||||
destination += ".desktop";
|
||||
QFile f(destination);
|
||||
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, "'", "'\\''");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue