summaryrefslogtreecommitdiffstats
path: root/src/tools/cmake_automoc_parser
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/cmake_automoc_parser')
-rw-r--r--src/tools/cmake_automoc_parser/CMakeLists.txt5
-rw-r--r--src/tools/cmake_automoc_parser/main.cpp14
2 files changed, 7 insertions, 12 deletions
diff --git a/src/tools/cmake_automoc_parser/CMakeLists.txt b/src/tools/cmake_automoc_parser/CMakeLists.txt
index 0209d0f7f9..a58c9c9ff1 100644
--- a/src/tools/cmake_automoc_parser/CMakeLists.txt
+++ b/src/tools/cmake_automoc_parser/CMakeLists.txt
@@ -1,5 +1,5 @@
# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## moc Tool:
@@ -8,8 +8,9 @@
qt_get_tool_target_name(target_name cmake_automoc_parser)
qt_internal_add_tool(${target_name}
CORE_LIBRARY Bootstrap
+ TARGET_DESCRIPTION "Qt CMake AUTOMOC Parser"
INSTALL_DIR "${INSTALL_LIBEXECDIR}"
- TOOLS_TARGET Core # special case
+ TOOLS_TARGET Core
SOURCES
main.cpp
DEFINES
diff --git a/src/tools/cmake_automoc_parser/main.cpp b/src/tools/cmake_automoc_parser/main.cpp
index 801483cdd7..de484b184b 100644
--- a/src/tools/cmake_automoc_parser/main.cpp
+++ b/src/tools/cmake_automoc_parser/main.cpp
@@ -185,17 +185,14 @@ static bool writeJsonFiles(const QList<QString> &fileList, const QString &fileLi
}
qint64 timestamp = std::numeric_limits<qint64>::min();
- QByteArray timestampBuffer = timestampFile.readAll();
- if (timestampBuffer.size() == sizeof(timestamp)) {
- QDataStream istream(&timestampBuffer, QIODevice::ReadOnly);
- istream >> timestamp;
- }
+ if (timestampFile.size() == sizeof(timestamp))
+ timestampFile.read(reinterpret_cast<char *>(&timestamp), sizeof(timestamp));
// Check if any of the metatype json files produced by automoc is newer than the last file
// 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;
}
@@ -215,11 +212,8 @@ static bool writeJsonFiles(const QList<QString> &fileList, const QString &fileLi
textStream.flush();
// Update the timestamp according the newest json file timestamp.
- timestampBuffer.clear();
- QDataStream ostream(&timestampBuffer, QIODevice::WriteOnly);
- ostream << timestamp;
timestampFile.resize(0);
- timestampFile.write(timestampBuffer);
+ timestampFile.write(reinterpret_cast<char *>(&timestamp), sizeof(timestamp));
}
return true;
}