From 33ad65e65092a15c8c9937cb6548b6e4446fbdf3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 8 Aug 2013 18:33:23 +0200 Subject: [PATCH] add -pro-debug option: trace .pro evaluation (like qmake -d) Change-Id: I2f6a3d43fa5e65fb6bfa44c17d833d9b8a30e06a Reviewed-by: hjk --- src/linguist/lupdate/lupdate.pro | 2 ++ src/linguist/lupdate/main.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/linguist/lupdate/lupdate.pro b/src/linguist/lupdate/lupdate.pro index da38078..da4a58b 100644 --- a/src/linguist/lupdate/lupdate.pro +++ b/src/linguist/lupdate/lupdate.pro @@ -12,6 +12,8 @@ DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII include(../shared/formats.pri) include(../shared/proparser.pri) +DEFINES += PROEVALUATOR_DEBUG + SOURCES += \ main.cpp \ merge.cpp \ diff --git a/src/linguist/lupdate/main.cpp b/src/linguist/lupdate/main.cpp index c94b653..dd2133d 100644 --- a/src/linguist/lupdate/main.cpp +++ b/src/linguist/lupdate/main.cpp @@ -229,6 +229,8 @@ static void printUsage() " different file suffix. Projects are recursed into and merged.\n" " -pro-out \n" " Virtual output directory for processing subsequent .pro files.\n" + " -pro-debug\n" + " Trace processing .pro files. Specify twice for more verbosity.\n" " -source-language [_]\n" " Specify the language of the source strings for new files.\n" " Defaults to POSIX if not specified.\n" @@ -693,6 +695,7 @@ int main(int argc, char **argv) UpdateOptions options = Verbose | // verbose is on by default starting with Qt 4.2 HeuristicSameText | HeuristicSimilarText | HeuristicNumber; + int proDebug = 0; int numFiles = 0; bool metTsFlag = false; bool recursiveScan = true; @@ -720,6 +723,9 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-silent")) { options &= ~Verbose; continue; + } else if (arg == QLatin1String("-pro-debug")) { + proDebug++; + continue; } else if (arg == QLatin1String("-target-language")) { ++i; if (i == argc) { @@ -996,6 +1002,7 @@ int main(int argc, char **argv) option.qmake_abslocation = QString::fromLocal8Bit(qgetenv("QMAKE")); if (option.qmake_abslocation.isEmpty()) option.qmake_abslocation = app.applicationDirPath() + QLatin1String("/qmake"); + option.debugLevel = proDebug; option.initProperties(); option.setCommandLineArguments(QDir::currentPath(), QStringList() << QLatin1String("CONFIG+=lupdate_run")); -- 2.7.4