diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-11-05 15:19:02 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-11-06 22:58:01 +0100 |
commit | 0a1db39ba70060f305e5694d1a12dd3c2e5bca4c (patch) | |
tree | 0e5786d7497ac56e2ef0ba2a665c7b0d642a4c62 /tools/linguist/lupdate/cpp.cpp | |
parent | a66698f947e8ded2e020defa626b154aca1fde9f (diff) | |
download | qt4-tools-0a1db39ba70060f305e5694d1a12dd3c2e5bca4c.tar.gz |
record id-based messages even if they have an empty source
this makes sense if one uses lupdate only for validation purposes, i.e.
to find out if the code uses only ids which are defined in some external
specification.
Diffstat (limited to 'tools/linguist/lupdate/cpp.cpp')
-rw-r--r-- | tools/linguist/lupdate/cpp.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp index fb95a95f8a..443abd0f3a 100644 --- a/tools/linguist/lupdate/cpp.cpp +++ b/tools/linguist/lupdate/cpp.cpp @@ -1883,22 +1883,18 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) case Tok_trid: if (!tor) goto case_default; - if (sourcetext.isEmpty()) { - yyTok = getToken(); - } else { - if (!msgid.isEmpty()) - qWarning("%s:%d: //= cannot be used with qtTrId() / QT_TRID_NOOP(). Ignoring\n", - qPrintable(yyFileName), yyLineNo); - //utf8 = false; // Maybe use //%% or something like that - line = yyLineNo; - yyTok = getToken(); - if (match(Tok_LeftParen) && matchString(&msgid) && !msgid.isEmpty()) { - bool plural = match(Tok_Comma); - recordMessage(line, QString(), sourcetext, QString(), extracomment, - msgid, extra, false, plural); - } - sourcetext.clear(); + if (!msgid.isEmpty()) + qWarning("%s:%d: //= cannot be used with qtTrId() / QT_TRID_NOOP(). Ignoring\n", + qPrintable(yyFileName), yyLineNo); + //utf8 = false; // Maybe use //%% or something like that + line = yyLineNo; + yyTok = getToken(); + if (match(Tok_LeftParen) && matchString(&msgid) && !msgid.isEmpty()) { + bool plural = match(Tok_Comma); + recordMessage(line, QString(), sourcetext, QString(), extracomment, + msgid, extra, false, plural); } + sourcetext.clear(); extracomment.clear(); msgid.clear(); extra.clear(); |