diff options
Diffstat (limited to 'src/tools/qdoc/tree.cpp')
-rw-r--r-- | src/tools/qdoc/tree.cpp | 73 |
1 files changed, 36 insertions, 37 deletions
diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp index 1b0aba1a0c..6c21d730c1 100644 --- a/src/tools/qdoc/tree.cpp +++ b/src/tools/qdoc/tree.cpp @@ -181,9 +181,9 @@ FunctionNode* Tree::findFunctionNode(const QStringList& parentPath, const Functi parent = findClassNode(parentPath, 0); if (parent == 0) parent = findNode(parentPath, 0, 0, Node::DontCare); - if (parent == 0 || !parent->isInnerNode()) + if (parent == 0 || !parent->isAggregate()) return 0; - return ((const InnerNode*)parent)->findFunctionNode(clone); + return ((const Aggregate*)parent)->findFunctionNode(clone); } @@ -249,22 +249,22 @@ const FunctionNode* Tree::findFunctionNode(const QStringList& path, int i; for (i = 0; i < path.size(); ++i) { - if (node == 0 || !node->isInnerNode()) + if (node == 0 || !node->isAggregate()) break; const Node* next; if (i == path.size() - 1) - next = ((const InnerNode*) node)->findFunctionNode(path.at(i)); + next = ((const Aggregate*) node)->findFunctionNode(path.at(i)); else - next = ((const InnerNode*) node)->findChildNode(path.at(i), genus); + next = ((const Aggregate*) node)->findChildNode(path.at(i), genus); if (!next && node->isClass() && (findFlags & SearchBaseClasses)) { NodeList baseClasses = allBaseClasses(static_cast<const ClassNode*>(node)); foreach (const Node* baseClass, baseClasses) { if (i == path.size() - 1) - next = static_cast<const InnerNode*>(baseClass)->findFunctionNode(path.at(i)); + next = static_cast<const Aggregate*>(baseClass)->findFunctionNode(path.at(i)); else - next = static_cast<const InnerNode*>(baseClass)->findChildNode(path.at(i), genus); + next = static_cast<const Aggregate*>(baseClass)->findChildNode(path.at(i), genus); if (next) break; @@ -301,8 +301,8 @@ static const NodeTypeList& relatesTypes() { if (t.isEmpty()) { t.reserve(3); - t.append(NodeTypePair(Node::Class, Node::NoSubType)); - t.append(NodeTypePair(Node::Namespace, Node::NoSubType)); + t.append(NodeTypePair(Node::Class, Node::NoSubtype)); + t.append(NodeTypePair(Node::Namespace, Node::NoSubtype)); t.append(NodeTypePair(Node::Document, Node::HeaderFile)); } return t; @@ -320,13 +320,15 @@ static const NodeTypeList& relatesTypes() If a matching node is found, a pointer to it is returned. Otherwise 0 is returned. */ -InnerNode* Tree::findRelatesNode(const QStringList& path) +Aggregate* Tree::findRelatesNode(const QStringList& path) { Node* n = findNodeRecursive(path, 0, root(), relatesTypes()); - return ((n && n->isInnerNode()) ? static_cast<InnerNode*>(n) : 0); + return ((n && n->isAggregate()) ? static_cast<Aggregate*>(n) : 0); } /*! + Inserts function name \a funcName and function role \a funcRole into + the property function map for the specified \a property. */ void Tree::addPropertyFunction(PropertyNode* property, const QString& funcName, @@ -344,7 +346,7 @@ void Tree::addPropertyFunction(PropertyNode* property, This function does not resolve QML inheritance. */ -void Tree::resolveInheritance(InnerNode* n) +void Tree::resolveInheritance(Aggregate* n) { if (!n) n = root(); @@ -399,7 +401,7 @@ void Tree::resolveInheritanceHelper(int pass, ClassNode* cn) node) using the unqualified base class name. */ if (!n) { - InnerNode* parent = cn->parent(); + Aggregate* parent = cn->parent(); if (parent) // Exclude the root namespace if (parent->isNamespace() && !parent->name().isEmpty()) @@ -422,7 +424,7 @@ void Tree::resolveInheritanceHelper(int pass, ClassNode* cn) FunctionNode* from = findVirtualFunctionInBaseClasses(cn, func); if (from != 0) { if (func->virtualness() == FunctionNode::NonVirtual) - func->setVirtualness(FunctionNode::ImpureVirtual); + func->setVirtualness(FunctionNode::NormalVirtual); func->setReimplementedFrom(from); } } @@ -442,7 +444,7 @@ void Tree::resolveProperties() propEntry = unresolvedPropertyMap.constBegin(); while (propEntry != unresolvedPropertyMap.constEnd()) { PropertyNode* property = propEntry.key(); - InnerNode* parent = property->parent(); + Aggregate* parent = property->parent(); QString getterName = (*propEntry)[PropertyNode::Getter]; QString setterName = (*propEntry)[PropertyNode::Setter]; QString resetterName = (*propEntry)[PropertyNode::Resetter]; @@ -587,7 +589,7 @@ NodeList Tree::allBaseClasses(const ClassNode* classNode) const search at the tree root. \a subtype is not used unless \a type is \c{Document}. */ -Node* Tree::findNodeByNameAndType(const QStringList& path, Node::Type type) const +Node* Tree::findNodeByNameAndType(const QStringList& path, Node::NodeType type) const { return findNodeRecursive(path, 0, root(), type); } @@ -611,7 +613,7 @@ Node* Tree::findNodeByNameAndType(const QStringList& path, Node::Type type) cons Node* Tree::findNodeRecursive(const QStringList& path, int pathIndex, const Node* start, - Node::Type type) const + Node::NodeType type) const { if (!start || path.isEmpty()) return 0; // no place to start, or nothing to search for. @@ -622,7 +624,7 @@ Node* Tree::findNodeRecursive(const QStringList& path, return 0; // premature leaf } - InnerNode* current = static_cast<InnerNode*>(node); + Aggregate* current = static_cast<Aggregate*>(node); const NodeList& children = current->childNodes(); const QString& name = path.at(pathIndex); for (int i=0; i<children.size(); ++i) { @@ -678,7 +680,7 @@ Node* Tree::findNodeRecursive(const QStringList& path, if (pathIndex >= path.size()) return 0; - InnerNode* current = static_cast<InnerNode*>(start); + Aggregate* current = static_cast<Aggregate*>(start); const NodeList& children = current->childNodes(); for (int i=0; i<children.size(); ++i) { Node* n = children.at(i); @@ -778,7 +780,7 @@ const Node* Tree::findNodeForTarget(const QStringList& path, } while (current) { - if (current->isInnerNode()) { + if (current->isAggregate()) { const Node* node = matchPathAndTarget(path, path_idx, target, current, flags, genus, ref); if (node) return node; @@ -848,8 +850,8 @@ const Node* Tree::matchPathAndTarget(const QStringList& path, return t; } if (target.isEmpty()) { - if ((idx) == (path.size()-1) && node->isInnerNode() && (flags & SearchEnumValues)) { - t = static_cast<const InnerNode*>(node)->findEnumNodeForValue(path.at(idx)); + if ((idx) == (path.size()-1) && node->isAggregate() && (flags & SearchEnumValues)) { + t = static_cast<const Aggregate*>(node)->findEnumNodeForValue(path.at(idx)); if (t) return t; } @@ -863,7 +865,7 @@ const Node* Tree::matchPathAndTarget(const QStringList& path, return t; if (target.isEmpty()) { if ((idx) == (path.size()-1) && (flags & SearchEnumValues)) { - t = static_cast<const InnerNode*>(bc)->findEnumNodeForValue(path.at(idx)); + t = static_cast<const Aggregate*>(bc)->findEnumNodeForValue(path.at(idx)); if (t) return t; } @@ -915,20 +917,20 @@ const Node* Tree::findNode(const QStringList& path, } for (i = start_idx; i < path.size(); ++i) { - if (node == 0 || !node->isInnerNode()) + if (node == 0 || !node->isAggregate()) break; - const Node* next = static_cast<const InnerNode*>(node)->findChildNode(path.at(i), genus); + const Node* next = static_cast<const Aggregate*>(node)->findChildNode(path.at(i), genus); if (!next && (findFlags & SearchEnumValues) && i == path.size()-1) { - next = static_cast<const InnerNode*>(node)->findEnumNodeForValue(path.at(i)); + next = static_cast<const Aggregate*>(node)->findEnumNodeForValue(path.at(i)); } if (!next && ((genus == Node::CPP) || (genus == Node::DontCare)) && node->isClass() && (findFlags & SearchBaseClasses)) { NodeList baseClasses = allBaseClasses(static_cast<const ClassNode*>(node)); foreach (const Node* baseClass, baseClasses) { - next = static_cast<const InnerNode*>(baseClass)->findChildNode(path.at(i), genus); + next = static_cast<const Aggregate*>(baseClass)->findChildNode(path.at(i), genus); if (!next && (findFlags & SearchEnumValues) && i == path.size() - 1) - next = static_cast<const InnerNode*>(baseClass)->findEnumNodeForValue(path.at(i)); + next = static_cast<const Aggregate*>(baseClass)->findEnumNodeForValue(path.at(i)); if (next) { break; } @@ -980,7 +982,7 @@ QString Tree::getRef(const QString& target, const Node* node) const */ void Tree::insertTarget(const QString& name, const QString& title, - TargetRec::Type type, + TargetRec::TargetType type, Node* node, int priority) { @@ -991,7 +993,7 @@ void Tree::insertTarget(const QString& name, /*! */ -void Tree::resolveTargets(InnerNode* root) +void Tree::resolveTargets(Aggregate* root) { // need recursion foreach (Node* child, root->childNodes()) { @@ -1005,7 +1007,7 @@ void Tree::resolveTargets(InnerNode* root) bool alreadyThere = false; if (!nodes.empty()) { for (int i=0; i< nodes.size(); ++i) { - if (nodes[i]->subType() == Node::ExternalPage) { + if (nodes[i]->docSubtype() == Node::ExternalPage) { if (node->name() == nodes[i]->name()) { alreadyThere = true; break; @@ -1140,18 +1142,15 @@ const DocumentNode* Tree::findDocumentNodeByTitle(const QString& title) const DocumentNodeMultiMap::const_iterator j = i; ++j; if (j != docNodesByTitle_.constEnd() && j.key() == i.key()) { - QList<Location> internalLocations; while (j != docNodesByTitle_.constEnd()) { if (j.key() == i.key() && j.value()->url().isEmpty()) { - internalLocations.append(j.value()->location()); break; // Just report one duplicate for now. } ++j; } - if (internalLocations.size() > 0) { + if (j != docNodesByTitle_.cend()) { i.value()->location().warning("This page title exists in more than one file: " + title); - foreach (const Location &location, internalLocations) - location.warning("[It also exists here]"); + j.value()->location().warning("[It also exists here]"); } } return i.value(); @@ -1252,7 +1251,7 @@ CollectionNode* Tree::findCollection(const QString& name, Node::Genus genus) CNMap::const_iterator i = m->constFind(name); if (i != m->cend()) return i.value(); - Node::Type t = Node::NoType; + Node::NodeType t = Node::NoType; switch (genus) { case Node::DOC: t = Node::Group; |