Changeset 846 for trunk/tools/qdoc3/tree.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/tools/qdoc3/tree.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 44 44 */ 45 45 46 #include <QtCore>47 46 #include <QDomDocument> 48 47 … … 54 53 #include "text.h" 55 54 #include "tree.h" 55 56 57 56 58 57 59 QT_BEGIN_NAMESPACE … … 124 126 /*! 125 127 */ 126 Node *Tree::findNode(const QStringList &path, Node *relative, int findFlags )128 Node *Tree::findNode(const QStringList &path, Node *relative, int findFlags) 127 129 { 128 130 return const_cast<Node*>(const_cast<const Tree*>(this)->findNode(path, 129 131 relative, 130 findFlags)); 131 } 132 133 /*! 134 */ 135 const Node *Tree::findNode(const QStringList &path, 136 const Node *relative, 137 int findFlags) const 138 { 139 if (!relative) 140 relative = root(); 132 findFlags, 133 self)); 134 } 135 136 /*! 137 */ 138 const Node* Tree::findNode(const QStringList &path, 139 const Node* start, 140 int findFlags, 141 const Node* self) const 142 { 143 const Node* current = start; 144 if (!current) 145 current = root(); 141 146 142 147 do { 143 const Node *node = relative;148 const Node *node = ; 144 149 int i; 145 150 … … 150 155 const Node *next = 151 156 static_cast<const InnerNode*>(node)->findNode(path.at(i)); 157 152 158 if (!next && (findFlags & SearchEnumValues) && i == path.size()-1) 153 159 next = static_cast<const InnerNode*>(node)->findEnumNodeForValue(path.at(i)); … … 168 174 if (node && i == path.size() 169 175 && (!(findFlags & NonFunction) || node->type() != Node::Function 170 || ((FunctionNode *)node)->metaness() == FunctionNode::MacroWithoutParams)) 171 return node; 172 relative = relative->parent(); 173 } while (relative); 176 || ((FunctionNode *)node)->metaness() == FunctionNode::MacroWithoutParams)) { 177 if ((node != self) && (node->subType() != Node::QmlPropertyGroup)) { 178 return node; 179 } 180 } 181 current = current->parent(); 182 } while (current); 174 183 175 184 return 0; … … 461 470 NodeList::ConstIterator c = rootNode->childNodes().begin(); 462 471 while (c != rootNode->childNodes().end()) { 463 if ((*c)->type() == Node::Class) 472 if ((*c)->type() == Node::Class) 464 473 resolveInheritance(pass, (ClassNode *) *c); 474 465 475 else if ((*c)->type() == Node::Namespace) { 466 476 NamespaceNode *ns = static_cast<NamespaceNode*>(*c); … … 534 544 ClassNode *baseClass = (ClassNode*)findNode((*b).basePath, 535 545 Node::Class); 536 if (!baseClass && (*b).parent) 546 if (!baseClass && (*b).parent) 537 547 baseClass = (ClassNode*)findNode((*b).basePath, 538 548 Node::Class, 539 549 (*b).parent); 540 if (baseClass) 550 } 551 if (baseClass) { 541 552 classe->addBaseClass((*b).access, 542 553 baseClass, 543 554 (*b).dataTypeWithTemplateArgs); 555 544 556 ++b; 545 557 } … … 1119 1131 nodeName = "target"; 1120 1132 break; 1133 1134