summaryrefslogtreecommitdiffstats
path: root/tools/linguist/lupdate
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-03 16:08:08 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-04 16:16:45 (GMT)
commitdf12ef0e1fa327103b09e9a817d83b8c8d3035d7 (patch)
tree220179f8e96da96a87202e4ded868d67b2e161f9 /tools/linguist/lupdate
parent7a0b728452c099934dbe7860c3614dfdc4373a9c (diff)
downloadQt-df12ef0e1fa327103b09e9a817d83b8c8d3035d7.zip
Qt-df12ef0e1fa327103b09e9a817d83b8c8d3035d7.tar.gz
Qt-df12ef0e1fa327103b09e9a817d83b8c8d3035d7.tar.bz2
fix bogus "Class '<foo>' lacks Q_OBJECT macro"
the optimization not to look for parent definitions if we already knew that there would be none did not consider that we only know that the leaf node is missing, not any intermediate nodes.
Diffstat (limited to 'tools/linguist/lupdate')
-rw-r--r--tools/linguist/lupdate/cpp.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index 02e87a0..5ef7099 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -271,7 +271,7 @@ private:
const Namespace *findNamespace(const NamespaceList &namespaces, int nsCount = -1) const;
void enterNamespace(NamespaceList *namespaces, const HashString &name);
void truncateNamespaces(NamespaceList *namespaces, int lenght);
- Namespace *modifyNamespace(NamespaceList *namespaces, bool tryOrigin = true);
+ Namespace *modifyNamespace(NamespaceList *namespaces, bool haveLast = true);
enum {
Tok_Eof, Tok_class, Tok_friend, Tok_namespace, Tok_using, Tok_return,
@@ -963,7 +963,7 @@ void CppParser::loadState(const SavedState *state)
pendingContext = state->pendingContext;
}
-Namespace *CppParser::modifyNamespace(NamespaceList *namespaces, bool tryOrigin)
+Namespace *CppParser::modifyNamespace(NamespaceList *namespaces, bool haveLast)
{
Namespace *pns, *ns = &results->rootNamespace;
for (int i = 1; i < namespaces->count(); ++i) {
@@ -971,7 +971,7 @@ Namespace *CppParser::modifyNamespace(NamespaceList *namespaces, bool tryOrigin)
if (!(ns = pns->children.value(namespaces->at(i)))) {
do {
ns = new Namespace;
- if (tryOrigin)
+ if (haveLast || i < namespaces->count() - 1)
if (const Namespace *ons = findNamespace(*namespaces, i + 1))
ns->classDef = ons->classDef;
pns->children.insert(namespaces->at(i), ns);