Mercurial > dedupe
comparison FileDBLink.cpp @ 15:199fc63c60c1
Increase buffersize for filehash computing.
| author | Tom Fredrik Blenning Klaussen <bfg@sim.no> |
|---|---|
| date | Sat, 25 Aug 2012 01:42:13 +0200 |
| parents | 9463c0c22969 |
| children | b2c2c2bf2bbd |
comparison
equal
deleted
inserted
replaced
| 14:e60d6caceb62 | 15:199fc63c60c1 |
|---|---|
| 35 addFile(fileinfo.absoluteFilePath(), fileinfo.size(), fileinfo.lastModified()); | 35 addFile(fileinfo.absoluteFilePath(), fileinfo.size(), fileinfo.lastModified()); |
| 36 } | 36 } |
| 37 | 37 |
| 38 QByteArray FileDBLink::computeHash(const QString& path, QCryptographicHash::Algorithm algorithm) | 38 QByteArray FileDBLink::computeHash(const QString& path, QCryptographicHash::Algorithm algorithm) |
| 39 { | 39 { |
| 40 const static uint buffersize = 8192; | 40 const static uint buffersize = 32768; |
| 41 QCryptographicHash hash(algorithm); | 41 QCryptographicHash hash(algorithm); |
| 42 QFile file(path); | 42 QFile file(path); |
| 43 if ( file.open( QIODevice::ReadOnly ) ) { | 43 if ( file.open( QIODevice::ReadOnly ) ) { |
| 44 while(!file.atEnd()){ | 44 while(!file.atEnd()){ |
| 45 hash.addData(file.read(buffersize)); | 45 hash.addData(file.read(buffersize)); |
