old render cleanup part 3

This commit is contained in:
Agel committed 2026-10-25 15:43:51 +01:00
1 parent cef762c3ee
commit 3faedd4251
45 files changed
+1057 -1135

No files matched your search

+13
View File
@@ -1,6 +1,8 @@
#pragma once
#include <QByteArray>
#include <QCryptographicHash>
#include <QFile>
#include <QString>
#include <QStringList>
@@ -22,4 +24,15 @@ public:
// MD5 of the source. For archives: MD5 of file bytes.
// For directories: MD5 of sorted "name:size\n" lines.
virtual QByteArray contentHash() const = 0;
// Shared MD5 calculation for files on disk.
static QByteArray hashFileMd5(const QString &filePath)
{
if (filePath.isEmpty())
return {};
QFile f(filePath);
if (f.open(QIODevice::ReadOnly))
return QCryptographicHash::hash(f.readAll(), QCryptographicHash::Md5);
return {};
}
};