summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2019-05-24 14:40:54 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2019-05-24 16:37:39 +0200
commit9ff6df892925b4b56b842ff206dd672e75e36138 (patch)
tree8f011869d810faccfff9e4e64bfb409dfaddf958 /src/tools
parent325d5b58a25a2893261c2c69fc8381abc87cceac (diff)
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/androiddeployqt/main.cpp19
1 files changed, 17 insertions, 2 deletions
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;