From 1b923e16be56476889a19094f35a954223e94e18 Mon Sep 17 00:00:00 2001 From: APTX Date: Wed, 25 Dec 2019 22:47:59 +0900 Subject: [PATCH] Replace deprecated QTime with QElapsedTimer --- hash.cpp | 4 ++-- hash.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hash.cpp b/hash.cpp index c540ce6..84b4a7d 100644 --- 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 41f5080..1a0b9b8 100644 --- a/hash.h +++ b/hash.h @@ -6,7 +6,7 @@ #include #include #include -#include +#include #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; }; -- 2.52.0