mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJClient.git
synced 2026-03-28 05:25:39 +03:00
feat: fast hash checker
This commit is contained in:
34
Core/fasthashcalculator.h
Normal file
34
Core/fasthashcalculator.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef FASTHASHCALCULATOR_H
|
||||
#define FASTHASHCALCULATOR_H
|
||||
|
||||
#include <QHash>
|
||||
#include <QMutex>
|
||||
#include <QObject>
|
||||
#include <QFile>
|
||||
#include <QDirIterator>
|
||||
#include <Data/FileData.h>
|
||||
#include "tools.h"
|
||||
|
||||
|
||||
class FastHashCalculator : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit FastHashCalculator(QObject *parent = nullptr);
|
||||
void calculateHashes(const QString& path, const QString& ignoreName);
|
||||
QList<FileData> *getHashList() const;
|
||||
|
||||
signals:
|
||||
void finished();
|
||||
|
||||
private:
|
||||
QByteArray calculateFileHashOptimized(const QString &filePath);
|
||||
void calculateSingleHash(const QString &filePath);
|
||||
|
||||
QList<FileData>* hashList;
|
||||
QMutex _mutex;
|
||||
quint64 currentSize;
|
||||
|
||||
};
|
||||
|
||||
#endif // FASTHASHCALCULATOR_H
|
||||
Reference in New Issue
Block a user