Skip to content

Commit

Permalink
Fix "error on writing to disk" that sometimes appears after "cancel"
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
maxnet committed Feb 3, 2022
1 parent 538cf8c commit 078985b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion downloadthread.cpp
Expand Up @@ -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;
}
Expand Down Expand Up @@ -439,6 +440,7 @@ void DownloadThread::run()
}
else
#endif
if (!_cancelled)
_onDownloadError(tr("Error writing file to disk"));
break;
case CURLE_ABORTED_BY_CALLBACK:
Expand Down

0 comments on commit 078985b

Please sign in to comment.