summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Kosmale <[email protected]>2024-12-13 10:40:00 +0100
committerFabian Kosmale <[email protected]>2024-12-13 16:53:09 +0100
commit47be32b761ea6e1f2c1bfa9dd9eb38846ce2fd45 (patch)
tree8de10c41568906f2162dc5735f57d0f867e21e6c
parent5b805f54c22636ce0fb631f724cb8ff87b905ca4 (diff)
moc: Always indentify as moc
External tools might rely on the output of "moc --version" to identify moc, and, depending on how robust their parsing is, could break if the reported name does not equal "moc". Explicitly set the application name to moc, so that even if the moc binary gets renamed and invoked via a symlink, it will still correctly identify itself. This might help with both binaries from the Qt Company's installer, as well as with distros which rename moc to moc6. Pick-to: 6.9 6.8 6.5 Task-number: QLS-1605 Change-Id: Id85e2ffa17d445213da0b37e7bd038d7b68e2c2a Reviewed-by: Ulf Hermann <[email protected]>
-rw-r--r--src/tools/moc/main.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tools/moc/main.cpp b/src/tools/moc/main.cpp
index f63e74226a5..71f3d86567f 100644
--- a/src/tools/moc/main.cpp
+++ b/src/tools/moc/main.cpp
@@ -171,6 +171,8 @@ int runMoc(int argc, char **argv)
{
QCoreApplication app(argc, argv);
QCoreApplication::setApplicationVersion(QString::fromLatin1(QT_VERSION_STR));
+ // let moc identify itself as moc, even if the binary has been renamed
+ QCoreApplication::setApplicationName(QString::fromLatin1("moc"));
bool autoInclude = true;
bool defaultInclude = true;