summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-09-18 15:52:10 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-09-23 13:44:28 (GMT)
commit57df91e20b8e669f4833e1f11dc2474d8118e0c9 (patch)
tree4127d54be508f3928c9e8ed1fdedd968b9426156
parentb647762117f49a3e8d20ceba84c47d4fb2941722 (diff)
downloadQt-57df91e20b8e669f4833e1f11dc2474d8118e0c9.zip
Qt-57df91e20b8e669f4833e1f11dc2474d8118e0c9.tar.gz
Qt-57df91e20b8e669f4833e1f11dc2474d8118e0c9.tar.bz2
optimize/clarify function context stringification
-rw-r--r--tools/linguist/lupdate/cpp.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index 5dbb8e2..d5d2e10 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -1590,14 +1590,14 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
}
while (!functionContext.at(idx - 1)->hasTrFunctions) {
if (idx == 1 || !functionContext.at(idx - 2)->isClass) {
- idx = functionContext.length();
+ context = stringifyNamespace(functionContext);
if (!functionContext.last()->complained) {
qWarning("%s:%d: Class '%s' lacks Q_OBJECT macro\n",
qPrintable(yyFileName), yyLineNo,
- qPrintable(stringifyNamespace(functionContext)));
+ qPrintable(context));
functionContext.last()->complained = true;
}
- break;
+ goto gotctx;
}
--idx;
}
@@ -1626,19 +1626,20 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions)
NamespaceList nsl;
QStringList unresolved;
if (fullyQualify(functionContext, prefix.split(strColons), false, &nsl, &unresolved)) {
+ context = stringifyNamespace(nsl);
if (!nsl.last()->hasTrFunctions && !nsl.last()->complained) {
qWarning("%s:%d: Class '%s' lacks Q_OBJECT macro\n",
qPrintable(yyFileName), yyLineNo,
- qPrintable(stringifyNamespace(nsl)));
+ qPrintable(context));
nsl.last()->complained = true;
}
- context = stringifyNamespace(nsl);
} else {
context = (stringListifyNamespace(nsl) + unresolved).join(strColons);
}
prefix.clear();
}
+ gotctx:
recordMessage(line, context, text, comment, extracomment, msgid, extra, utf8, plural);
}
extracomment.clear();