Fix "error on writing to disk" that sometimes appears after "cancel"

- Do not generate "error on writing to disk" error if it is the
  result of the write being cancelled.
- Mac: QProcess::execute(cmdline) -> QProcess::execute(cmd, args)
  to avoid depreceation warning.
This commit is contained in:
Floris Bos 2022-02-03 11:41:54 +01:00
parent 538cf8c9dd
commit 078985b312

View file

@ -196,7 +196,8 @@ bool DownloadThread::_openAndPrepareDevice()
} else if (authopenresult == _file.authOpenError) {
QString msg = tr("Error running authopen to gain access to disk device '%1'").arg(QString(_filename));
msg += "<br>"+tr("Please verify if 'Raspberry Pi Imager' is allowed access to 'removable volumes' in privacy settings (under 'files and folders' or alternatively give it 'full disk access').");
QProcess::execute("open x-apple.systempreferences:com.apple.preference.security?Privacy_RemovableVolume");
QStringList args("x-apple.systempreferences:com.apple.preference.security?Privacy_RemovableVolume");
QProcess::execute("open", args);
emit error(msg);
return false;
}
@ -439,6 +440,7 @@ void DownloadThread::run()
}
else
#endif
if (!_cancelled)
_onDownloadError(tr("Error writing file to disk"));
break;
case CURLE_ABORTED_BY_CALLBACK: