From: APTX Date: Wed, 25 Dec 2019 13:47:59 +0000 (+0900) Subject: Replace deprecated QTime with QElapsedTimer X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=1b923e16be56476889a19094f35a954223e94e18;p=anidbudpclient.git Replace deprecated QTime with QElapsedTimer --- 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; };