From: Stephen Kelly Date: Tue, 19 Jun 2012 16:05:44 +0000 (+0200) Subject: Allow the specification of includes in the lst-file in lupdate. X-Git-Tag: accepted/tizen/20131212.181521~294 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a1eae5523c27a61b971b7a3d475a0c53cbea166;p=platform%2Fupstream%2Fqttools.git Allow the specification of includes in the lst-file in lupdate. Change-Id: I95805637b7c1bb7f6774a47928f21701ba212298 Reviewed-by: Oswald Buddenhagen --- 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; }