##// END OF EJS Templates
Add implementation of abort impact on Amda plugin
perrinel -
r431:716a6a462efc
parent child
Show More
@@ -98,6 +98,9 void AmdaProvider::retrieveData(QUuid token, const SqpDateTime &dateTime, const
98 = [this, dateTime, tempFile, token](QNetworkReply *reply, QUuid dataId) noexcept {
98 = [this, dateTime, tempFile, token](QNetworkReply *reply, QUuid dataId) noexcept {
99 Q_UNUSED(dataId);
99 Q_UNUSED(dataId);
100
100
101 // Don't do anything if the reply was abort
102 if (reply->error() != QNetworkReply::OperationCanceledError) {
103
101 if (tempFile) {
104 if (tempFile) {
102 auto replyReadAll = reply->readAll();
105 auto replyReadAll = reply->readAll();
103 if (!replyReadAll.isEmpty()) {
106 if (!replyReadAll.isEmpty()) {
@@ -113,12 +116,14 void AmdaProvider::retrieveData(QUuid token, const SqpDateTime &dateTime, const
113 /// @todo ALX : debug
116 /// @todo ALX : debug
114 }
117 }
115 }
118 }
116
119 }
117
120
118 };
121 };
119 auto httpFinishedLambda = [this, httpDownloadFinished, tempFile](QNetworkReply *reply,
122 auto httpFinishedLambda
120 QUuid dataId) noexcept {
123 = [this, httpDownloadFinished, tempFile](QNetworkReply *reply, QUuid dataId) noexcept {
121
124
125 // Don't do anything if the reply was abort
126 if (reply->error() != QNetworkReply::OperationCanceledError) {
122 auto downloadFileUrl = QUrl{QString{reply->readAll()}};
127 auto downloadFileUrl = QUrl{QString{reply->readAll()}};
123
128
124
129
@@ -127,7 +132,9 void AmdaProvider::retrieveData(QUuid token, const SqpDateTime &dateTime, const
127 // Creates destination file
132 // Creates destination file
128 if (tempFile->open()) {
133 if (tempFile->open()) {
129 // Executes request
134 // Executes request
130 emit requestConstructed(QNetworkRequest{downloadFileUrl}, dataId, httpDownloadFinished);
135 emit requestConstructed(QNetworkRequest{downloadFileUrl}, dataId,
136 httpDownloadFinished);
137 }
131 }
138 }
132 };
139 };
133
140
General Comments 0
You need to be logged in to leave comments. Login now