From 5a1eae5523c27a61b971b7a3d475a0c53cbea166 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 19 Jun 2012 18:05:44 +0200 Subject: [PATCH] Allow the specification of includes in the lst-file in lupdate. Change-Id: I95805637b7c1bb7f6774a47928f21701ba212298 Reviewed-by: Oswald Buddenhagen --- src/linguist/lupdate/main.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/linguist/lupdate/main.cpp b/src/linguist/lupdate/main.cpp index 74fce20..7ae3fe6 100644 --- a/src/linguist/lupdate/main.cpp +++ b/src/linguist/lupdate/main.cpp @@ -140,7 +140,8 @@ static void printUsage() " -version\n" " Display the version of lupdate and exit.\n" " @lst-file\n" - " Read additional file names (one per line) from lst-file.\n" + " Read additional file names (one per line) or includepaths (one per\n" + " line, and prefixed with -I) from lst-file.\n" ).arg(m_defaultExtensions)); } @@ -642,8 +643,19 @@ int main(int argc, char **argv) .arg(lstFile.fileName())); return 1; } - while (!lstFile.atEnd()) - files << QString::fromLocal8Bit(lstFile.readLine().trimmed()); + while (!lstFile.atEnd()) { + QString lineContent = QString::fromLocal8Bit(lstFile.readLine().trimmed()); + + if (lineContent.startsWith(QLatin1Literal("-I"))) { + if (lineContent.length() == 2) { + printErr(LU::tr("The -I option should be followed by a path.\n")); + return 1; + } + includePath += lineContent.mid(2); + } else { + files << lineContent; + } + } } else { files << arg; } -- 2.7.4