| 307 | } |
| 308 | |
| 309 | NetAction::Ptr AssetObject::getDownloadAction() |
| 310 | { |
| 311 | QFileInfo objectFile(getLocalPath()); |
| 312 | if ((!objectFile.isFile()) || (objectFile.size() != size)) |
| 313 | { |
| 314 | auto objectDL = Net::Download::makeFile(getUrl(), objectFile.filePath()); |
| 315 | if(hash.size()) |
| 316 | { |
| 317 | auto rawHash = QByteArray::fromHex(hash.toLatin1()); |
| 318 | objectDL->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, rawHash)); |
| 319 | } |
| 320 | objectDL->setProgress(objectDL->getProgress(), size); |
| 321 | return objectDL; |
| 322 | } |
| 323 | return nullptr; |
| 324 | } |
| 325 | |
| 326 | QString AssetObject::getLocalPath() |
| 327 | { |
no test coverage detected