if (_resumeStart == _item->_size) {
qDebug() << "File is already complete, no need to download";
_tmpFile.close();
- downloadFinished();
+
+ // Unfortunately we lost the checksum header, if any...
+ QByteArray checksumHeader;
+ downloadFinished(checksumHeader);
return;
}
}
// will also emit the validated() signal to continue the flow in slot downloadFinished()
// as this is (still) also correct.
ValidateChecksumHeader *validator = new ValidateChecksumHeader(this);
- connect(validator, SIGNAL(validated(QByteArray)), this, SLOT(downloadFinished()));
+ connect(validator, SIGNAL(validated(QByteArray)), this, SLOT(downloadFinished(QByteArray)));
connect(validator, SIGNAL(validationFailed(QString)), this, SLOT(slotChecksumFail(QString)));
validator->start(_tmpFile.fileName(), job->reply()->rawHeader(checkSumHeaderC));
}
}
} // end namespace
-void PropagateDownloadFileQNAM::downloadFinished()
+void PropagateDownloadFileQNAM::downloadFinished(const QByteArray& checksumHeader)
{
+ if (!checksumHeader.isEmpty()) {
+ _item->_checksumHeader = checksumHeader;
+ }
+
QString fn = _propagator->getFilePath(_item->_file);
// In case of file name clash, report an error
private slots:
void slotGetFinished();
void abort() Q_DECL_OVERRIDE;
- void downloadFinished();
+ void downloadFinished(const QByteArray& checksumHeader);
void slotDownloadProgress(qint64,qint64);
void slotChecksumFail( const QString& errMsg );