Commit d71a5215 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

fwupd: fix downloading updates

parent f6f116a1
......@@ -60,6 +60,12 @@ void FwupdTransaction::install()
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
auto reply = manager->get(QNetworkRequest(uri));
QFile* file = new QFile(fileName);
if (!file->open(QFile::WriteOnly)) {
qWarning() << "Fwupd Error: Could not open to write" << fileName << uri;
setStatus(DoneWithErrorStatus);
file->deleteLater();
return;
}
connect(reply, &QNetworkReply::finished, this, [this, file, reply](){
file->close();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment