]> Some of my projects - anidbudpclient.git/commitdiff
Replace deprecated QTime with QElapsedTimer
authorAPTX <marek321@gmail.com>
Wed, 25 Dec 2019 13:47:59 +0000 (22:47 +0900)
committerAPTX <marek321@gmail.com>
Wed, 25 Dec 2019 13:47:59 +0000 (22:47 +0900)
hash.cpp
hash.h

index c540ce66b1da05daead61da81609f00ba9f7a9dc..84b4a7de04aaa7256718ae3403bc406f1f34c9fd 100644 (file)
--- a/hash.cpp
+++ b/hash.cpp
@@ -77,7 +77,7 @@ void Hash::endHashing(const QByteArray &hash)
        if (result)
        {
 #ifdef ANIDBUDPCLIENT_HASH_DEBUG
-       int fileElapsed = fileTime.elapsed();
+       auto fileElapsed = fileTime.elapsed();
        qDebug() << "File:" << result->fileInfo().fileName() << "Hash:" << hash << "Time:" << fileElapsed;
 #endif
                hashedFileSize += result->fileInfo().size();
@@ -95,7 +95,7 @@ void Hash::endHashing(const QByteArray &hash)
                hashing = false;
                emit finished();
 #ifdef ANIDBUDPCLIENT_HASH_DEBUG
-               int totalElapsed = totalTime.elapsed();
+               auto totalElapsed = totalTime.elapsed();
                qDebug() << "Total time:" << totalElapsed;
 #endif
                hashedFileSize = totalFileSize = 0;
diff --git a/hash.h b/hash.h
index 41f508004fb15abc1e1233185c9f04260753db17..1a0b9b8e780b9c543a4503b6ab52ae93cf532027 100644 (file)
--- a/hash.h
+++ b/hash.h
@@ -6,7 +6,7 @@
 #include <QQueue>
 #include <QMap>
 #include <QFileInfo>
-#include <QTime>
+#include <QElapsedTimer>
 
 #include "hashproducer.h"
 #include "hashconsumer.h"
@@ -60,8 +60,8 @@ private:
        qint64 hashedFileSize;
        qint64 totalFileSize;
 
-       QTime fileTime;
-       QTime totalTime;
+       QElapsedTimer fileTime;
+       QElapsedTimer totalTime;
 
        static Hash *m_instance;
 };