From 410a0f864a7e7a5f4150a21a8163de1078d0c846 Mon Sep 17 00:00:00 2001 From: APTX Date: Thu, 25 Aug 2011 18:05:09 +0200 Subject: [PATCH] Hash::endHashing has something to do even if it's a canceled request... --- hash.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hash.cpp b/hash.cpp index a63e9b9..c304985 100644 --- a/hash.cpp +++ b/hash.cpp @@ -61,6 +61,7 @@ void Hash::cancel(HashResult *result) if (fileQueue.first() == result && hashing) { fileQueue.first() = 0; + hashedFileSize += result->fileInfo().size(); return; } @@ -73,17 +74,17 @@ void Hash::endHashing(const QByteArray &hash) { HashResult *result = fileQueue.dequeue(); - if (!result) - return; - + if (result) + { #ifdef ANIDBUDPCLIENT_HASH_DEBUG int fileElapsed = fileTime.elapsed(); qDebug() << "File:" << result->fileInfo().fileName() << "Hash:" << hash << "Time:" << fileElapsed; #endif - hashedFileSize += result->fileInfo().size(); + hashedFileSize += result->fileInfo().size(); - result->setHash(hash); - emit resultReady(result); + result->setHash(hash); + emit resultReady(result); + } if (!fileQueue.isEmpty()) { -- 2.52.0