Improve checksum mismatch logging (#5413)

This commit is contained in:
Alexandru Ionut Tripon 2026-04-17 13:59:58 +00:00 committed by GitHub
commit af8225e2da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 7 deletions

View file

@ -38,7 +38,6 @@
#include "Validator.h"
#include <QCryptographicHash>
#include <QFile>
namespace Net {
class ChecksumValidator : public Validator {
@ -69,10 +68,10 @@ class ChecksumValidator : public Validator {
return true;
}
auto validate(QNetworkReply&) -> bool override
auto validate(QNetworkReply& reply) -> bool override
{
if (m_expected.size() && m_expected != hash()) {
qWarning() << "Checksum mismatch, download is bad.";
if (!m_expected.isEmpty() && m_expected != hash()) {
qWarning() << "Checksum mismatch for URL:" << reply.url().toString() << "expected:" << m_expected << "got:" << hash();
return false;
}
return true;