diff options
author | Katja Marttila <katja.marttila@qt.io> | 2023-06-14 11:53:24 +0300 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2023-09-05 07:32:44 +0300 |
commit | 077c75ca54ffefac118b3863aa0d5850baba03f8 (patch) | |
tree | 39e79a8df24eb6983748e834cea8019e32d98579 /src/libs/kdtools/filedownloader.cpp | |
parent | 26018095bf638456f3b64826a66aa7baf4dd15b4 (diff) |
Fix deprecated QCryptographichHash function call
Function QCryptographichHash::addData(const char *data, qsizetype length)
has been deprecated since 6.x.
Task-number: QTIFW-3077
Change-Id: I5c36d52d7e8fe4c1724072b33c1ff19e9f2fb846
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'src/libs/kdtools/filedownloader.cpp')
-rw-r--r-- | src/libs/kdtools/filedownloader.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/libs/kdtools/filedownloader.cpp b/src/libs/kdtools/filedownloader.cpp index 4150729d9..bbe60c2ad 100644 --- a/src/libs/kdtools/filedownloader.cpp +++ b/src/libs/kdtools/filedownloader.cpp @@ -658,14 +658,6 @@ void KDUpdater::FileDownloader::addCheckSumData(const QByteArray &data) } /*! - Adds the \a length of characters of \a data to the cryptographic hash of the downloaded file. -*/ -void KDUpdater::FileDownloader::addCheckSumData(const char *data, int length) -{ - d->m_hash.addData(data, length); -} - -/*! Resets SHA-1 checksum data of the downloaded file. */ void KDUpdater::FileDownloader::resetCheckSumData() @@ -921,7 +913,7 @@ void KDUpdater::LocalFileDownloader::timerEvent(QTimerEvent *event) toWrite -= numWritten; } addSample(numRead); - addCheckSumData(buffer.data(), numRead); + addCheckSumData(buffer.left(numRead)); if (numRead > 0) { setProgress(d->source->pos(), d->source->size()); emit downloadProgress(calcProgress(d->source->pos(), d->source->size())); @@ -1113,7 +1105,7 @@ void KDUpdater::ResourceFileDownloader::timerEvent(QTimerEvent *event) const qint64 numRead = d->destFile.read(buffer.data(), buffer.size()); addSample(numRead); - addCheckSumData(buffer.data(), numRead); + addCheckSumData(buffer.left(numRead)); if (numRead > 0) { setProgress(d->destFile.pos(), d->destFile.size()); @@ -1319,7 +1311,7 @@ void KDUpdater::HttpDownloader::httpReadyRead() written += numWritten; } addSample(written); - addCheckSumData(buffer.data(), read); + addCheckSumData(buffer.left(read)); updateBytesDownloadedBeforeResume(written); } } |