NetworkRequest onError now uses NetworkResult

This commit is contained in:
fourtf
2019-09-19 19:03:50 +02:00
parent 986694e4bc
commit 758a6bb41c
10 changed files with 60 additions and 72 deletions
+2 -5
View File
@@ -83,7 +83,7 @@ void Updates::installUpdates()
NetworkRequest(this->updatePortable_)
.timeout(600000)
.onError([this](int) -> bool {
.onError([this](NetworkResult) {
this->setStatus_(DownloadFailed);
postToThread([] {
@@ -94,8 +94,6 @@ void Updates::installUpdates()
box->show();
box->raise();
});
return true;
})
.onSuccess([this](auto result) -> Outcome {
QByteArray object = result.getData();
@@ -136,7 +134,7 @@ void Updates::installUpdates()
NetworkRequest(this->updateExe_)
.timeout(600000)
.onError([this](int) -> bool {
.onError([this](NetworkResult) {
this->setStatus_(DownloadFailed);
QMessageBox *box = new QMessageBox(
@@ -145,7 +143,6 @@ void Updates::installUpdates()
"downloading the update.");
box->setAttribute(Qt::WA_DeleteOnClose);
box->exec();
return true;
})
.onSuccess([this](auto result) -> Outcome {
QByteArray object = result.getData();