]> Some of my projects - anidbudpclient.git/commitdiff
Hash::endHashing has something to do even if it's a canceled request...
authorAPTX <marek321@gmail.com>
Thu, 25 Aug 2011 16:05:09 +0000 (18:05 +0200)
committerAPTX <marek321@gmail.com>
Thu, 25 Aug 2011 16:05:09 +0000 (18:05 +0200)
hash.cpp

index a63e9b96502cc832a1a160faa639954f9ead728d..c304985399e0471d5d171f594163fa65c00c065e 100644 (file)
--- 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())
        {