| 278 | } // namespace AssetsUtils |
| 279 | |
| 280 | Net::NetRequest::Ptr AssetObject::getDownloadAction() |
| 281 | { |
| 282 | QFileInfo objectFile(getLocalPath()); |
| 283 | if ((!objectFile.isFile()) || (objectFile.size() != size)) { |
| 284 | auto objectDL = Net::ApiDownload::makeFile(getUrl(), objectFile.filePath()); |
| 285 | if (hash.size()) { |
| 286 | objectDL->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, hash)); |
| 287 | } |
| 288 | objectDL->setProgress(objectDL->getProgress(), size); |
| 289 | return objectDL; |
| 290 | } |
| 291 | return nullptr; |
| 292 | } |
| 293 | |
| 294 | QString AssetObject::getLocalPath() |
| 295 | { |
no test coverage detected