diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2022-12-17 13:09:33 +0200 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2023-01-04 19:15:52 +0200 |
commit | 41867c25f8438eb34dddba9d058e32c73638b4f5 (patch) | |
tree | 96424418b8ce04ebba0140c4bafaa8a1c9135aa7 /src/tools/cmake_automoc_parser | |
parent | 7eff78e8a5ef484da973aa54ce689e3e266b1c69 (diff) |
Use QFileInfo's file times in UTC for file timestamps
This is inherently faster than getting it in UTC from the underlying
native API stat call, then converting it to the Local Time Zone just to
compare them. The same goes for any use-case where you get a QDateTime
then the first thing you do is call t.to{Msec,Secs}SinceEpoch().
Change-Id: Ic13bcfd99b937c9f10f102ea7741832950a553c6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Diffstat (limited to 'src/tools/cmake_automoc_parser')
-rw-r--r-- | src/tools/cmake_automoc_parser/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/cmake_automoc_parser/main.cpp b/src/tools/cmake_automoc_parser/main.cpp index 801483cdd7..86e10d48ad 100644 --- a/src/tools/cmake_automoc_parser/main.cpp +++ b/src/tools/cmake_automoc_parser/main.cpp @@ -195,7 +195,7 @@ static bool writeJsonFiles(const QList<QString> &fileList, const QString &fileLi // processed by cmake_automoc parser for (const auto &jsonFile : fileList) { const qint64 jsonFileLastModified = - QFileInfo(jsonFile).lastModified().toMSecsSinceEpoch(); + QFileInfo(jsonFile).lastModified(QTimeZone::UTC).toMSecsSinceEpoch(); if (jsonFileLastModified > timestamp) { timestamp = jsonFileLastModified; } |