From 9ff6df892925b4b56b842ff206dd672e75e36138 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 24 May 2019 14:40:54 +0200 Subject: Convert the one extant use of QTime as a timer to use a local class Use QDateTime::currentMSecsSinceEpoch() instead of a QTime with funky wrapping at midnight and potential DST glitches. Change-Id: I2455db5778635fc00b4ffdef6edee6d6793e50eb Reviewed-by: Thiago Macieira --- src/tools/androiddeployqt/main.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/tools') diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index 01c392f8f9..65d95362f7 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the tools applications of the Qt Toolkit. @@ -52,6 +52,21 @@ #define QT_POPEN_READ "r" #endif +class ActionTimer +{ + qint64 started; +public: + ActionTimer() = default; + void start() + { + started = QDateTime::currentMSecsSinceEpoch(); + } + int elapsed() + { + return int(QDateTime::currentMSecsSinceEpoch() - started); + } +}; + static const bool mustReadOutputAnyway = true; // pclose seems to return the wrong error code unless we read the output void deleteRecursively(const QString &dirName) @@ -138,7 +153,7 @@ struct Options bool gradle; bool auxMode; bool stripLibraries = true; - QTime timer; + ActionTimer timer; // External tools QString sdkPath; -- cgit v1.2.3