From c025d49119a58cf25eed64780b612f9c0629cde5 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 2 Oct 2013 12:51:45 +0200 Subject: qdoc: Eliminate uses of qmlModuleIdentifier() The QML module identifier is no longer useful. The function to generate it is retained for now. Task-number: QTBUG-32173 Change-Id: Ic811ed432f2059c0370e9e0d86b2e334b5c82a3c Reviewed-by: Martin Smith --- src/tools/qdoc/ditaxmlgenerator.cpp | 8 ++++---- src/tools/qdoc/generator.cpp | 4 ++-- src/tools/qdoc/htmlgenerator.cpp | 8 ++++---- src/tools/qdoc/node.cpp | 22 +++++++++++----------- src/tools/qdoc/node.h | 4 ++-- src/tools/qdoc/qdocdatabase.cpp | 21 +++++++++++---------- src/tools/qdoc/tree.cpp | 2 +- 7 files changed, 35 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp index 275fc9ecae..dfd3e03550 100644 --- a/src/tools/qdoc/ditaxmlgenerator.cpp +++ b/src/tools/qdoc/ditaxmlgenerator.cpp @@ -6109,8 +6109,8 @@ void DitaXmlGenerator::generateCollisionPages() for (int i=0; iqmlModuleIdentifier().isEmpty()) - t = n->qmlModuleIdentifier() + QLatin1Char(' '); + if (!n->qmlModuleName().isEmpty()) + t = n->qmlModuleName() + QLatin1Char(' '); t += protectEnc(fullTitle); nm.insertMulti(t,n); } @@ -6149,8 +6149,8 @@ void DitaXmlGenerator::generateCollisionPages() if (p) { QString link = linkForNode(p,0); QString label; - if (!n->qmlModuleIdentifier().isEmpty()) - label = n->qmlModuleIdentifier() + "::"; + if (!n->qmlModuleName().isEmpty()) + label = n->qmlModuleName() + "::"; label += n->name() + "::" + p->name(); writeStartTag(DT_li); writeStartTag(DT_xref); diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp index 3306447b34..e6c5ae9062 100644 --- a/src/tools/qdoc/generator.cpp +++ b/src/tools/qdoc/generator.cpp @@ -223,7 +223,7 @@ void Generator::appendSortedQmlNames(Text& text, const Node* base, const NodeLis for (int i = 0; i < subs.size(); ++i) { Text t; if (!base->isQtQuickNode() || !subs[i]->isQtQuickNode() || - (base->qmlModuleIdentifier() == subs[i]->qmlModuleIdentifier())) { + (base->qmlModuleName() == subs[i]->qmlModuleName())) { appendFullName(t, subs[i], base); classMap[t.toString().toLower()] = t; } @@ -470,7 +470,7 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir) else { QString mq; if (!node->qmlModuleName().isEmpty()) { - mq = node->qmlModuleIdentifier().replace(QChar('.'),QChar('-')); + mq = node->qmlModuleName().replace(QChar('.'),QChar('-')); mq = mq.toLower() + QLatin1Char('-'); } return fdl+ Generator::outputPrefix(QLatin1String("QML")) + mq + diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 835443a6a2..6004f3e398 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -1350,8 +1350,8 @@ void HtmlGenerator::generateCollisionPages() for (int i=0; iqmlModuleIdentifier().isEmpty()) - t = n->qmlModuleIdentifier() + "::"; + if (!n->qmlModuleName().isEmpty()) + t = n->qmlModuleName() + "::"; t += protectEnc(fullTitle); nm.insertMulti(t,n); } @@ -1387,8 +1387,8 @@ void HtmlGenerator::generateCollisionPages() if (p) { QString link = linkForNode(p,0); QString label; - if (!n->qmlModuleIdentifier().isEmpty()) - label = n->qmlModuleIdentifier() + "::"; + if (!n->qmlModuleName().isEmpty()) + label = n->qmlModuleName() + "::"; label += n->name() + "::" + p->name(); out() << "
  • "; out() << ""; diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp index 66e0455074..e854f101f6 100644 --- a/src/tools/qdoc/node.cpp +++ b/src/tools/qdoc/node.cpp @@ -130,8 +130,8 @@ QString Node::fullName(const Node* relative) const if (type() == Node::Document) { const DocNode* dn = static_cast(this); // Only print modulename::type on collision pages. - if (!dn->qmlModuleIdentifier().isEmpty() && relative != 0 && relative->isCollisionNode()) - return dn->qmlModuleIdentifier() + "::" + dn->title(); + if (!dn->qmlModuleName().isEmpty() && relative != 0 && relative->isCollisionNode()) + return dn->qmlModuleName() + "::" + dn->title(); return dn->title(); } else if (type() == Node::Class) { @@ -2204,7 +2204,7 @@ QString QmlClassNode::qmlFullBaseName() const { QString result; if (baseNode_) { - result = baseNode_->qmlModuleIdentifier() + "::" + baseNode_->name(); + result = baseNode_->qmlModuleName() + "::" + baseNode_->name(); } return result; } @@ -2356,13 +2356,13 @@ bool QmlPropertyNode::isWritable(QDocDatabase* qdb) location().warning(tr("No Q_PROPERTY for QML property %1::%2::%3 " "in C++ class documented as QML type: " "(property not found in the C++ class or its base classes)") - .arg(qmlModuleIdentifier()).arg(qmlTypeName()).arg(name())); + .arg(qmlModuleName()).arg(qmlTypeName()).arg(name())); } else location().warning(tr("No Q_PROPERTY for QML property %1::%2::%3 " "in C++ class documented as QML type: " "(C++ class not specified or not found).") - .arg(qmlModuleIdentifier()).arg(qmlTypeName()).arg(name())); + .arg(qmlModuleName()).arg(qmlTypeName()).arg(name())); } } return true; @@ -2505,18 +2505,18 @@ InnerNode* NameCollisionNode::findAny(Node::Type t, Node::SubType st) /*! This node is a name collision node. Find a child of this node - such that the child's QML module identifier matches origin's - QML module identifier. Return the matching node, or return this - node if there is no matching node. + such that the child's QML module name matches origin's QML module + Name. Return the matching node, or return this node if there is + no matching node. */ -const Node* NameCollisionNode::applyModuleIdentifier(const Node* origin) const +const Node* NameCollisionNode::applyModuleName(const Node* origin) const { - if (origin && !origin->qmlModuleIdentifier().isEmpty()) { + if (origin && !origin->qmlModuleName().isEmpty()) { const NodeList& cn = childNodes(); NodeList::ConstIterator i = cn.constBegin(); while (i != cn.constEnd()) { if ((*i)->type() == Node::Document && (*i)->subType() == Node::QmlClass) { - if (origin->qmlModuleIdentifier() == (*i)->qmlModuleIdentifier()) + if (origin->qmlModuleName() == (*i)->qmlModuleName()) return (*i); } ++i; diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h index a530a2cf23..9e736aeba6 100644 --- a/src/tools/qdoc/node.h +++ b/src/tools/qdoc/node.h @@ -274,7 +274,7 @@ public: virtual ClassNode* classNode() { return 0; } virtual void setClassNode(ClassNode* ) { } virtual void clearCurrentChild() { } - virtual const Node* applyModuleIdentifier(const Node* ) const { return 0; } + virtual const Node* applyModuleName(const Node* ) const { return 0; } virtual QString idNumber() { return "0"; } QmlClassNode* qmlClassNode(); ClassNode* declarativeCppNode(); @@ -556,7 +556,7 @@ public: virtual void clearCurrentChild() { current = 0; } virtual bool isQmlNode() const; virtual bool isCollisionNode() const { return true; } - virtual const Node* applyModuleIdentifier(const Node* origin) const; + virtual const Node* applyModuleName(const Node* origin) const; InnerNode* findAny(Node::Type t, Node::SubType st); void addCollision(InnerNode* child); const QMap& linkTargets() const { return targets; } diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp index 5d7620519e..e371d448c6 100644 --- a/src/tools/qdoc/qdocdatabase.cpp +++ b/src/tools/qdoc/qdocdatabase.cpp @@ -242,7 +242,7 @@ QmlModuleNode* QDocDatabase::addQmlModule(const QString& name) QmlModuleNode* qmn = findQmlModule(blankSplit[0]); qmn->setQmlModuleInfo(name); qmn->markSeen(); - masterMap_.insert(qmn->qmlModuleIdentifier(),qmn); + //masterMap_.insert(qmn->qmlModuleIdentifier(),qmn); return qmn; } @@ -561,7 +561,7 @@ void QDocDatabase::findAllObsoleteThings(const InnerNode* node) else if ((*c)->type() == Node::Document && (*c)->subType() == Node::QmlClass) { if (name.startsWith(QLatin1String("QML:"))) name = name.mid(4); - name = (*c)->qmlModuleIdentifier() + "::" + name; + name = (*c)->qmlModuleName() + "::" + name; obsoleteQmlTypes_.insert(name,*c); } } @@ -862,10 +862,10 @@ QDocDatabase::findUnambiguousTarget(const QString& target, QString& ref, const N return bestTarget.node_; } else if (bestTargetList.size() > 1) { - if (relative && !relative->qmlModuleIdentifier().isEmpty()) { + if (relative && !relative->qmlModuleName().isEmpty()) { for (int i=0; iqmlModuleIdentifier() == n->qmlModuleIdentifier()) { + if (n && relative->qmlModuleName() == n->qmlModuleName()) { ref = bestTargetList.at(i).ref_; return n; } @@ -887,19 +887,20 @@ const DocNode* QDocDatabase::findDocNodeByTitle(const QString& title, const Node QString key = Doc::canonicalTitle(title); DocNodeMultiMap::const_iterator i = docNodesByTitle_.constFind(key); if (i != docNodesByTitle_.constEnd()) { - if (relative && !relative->qmlModuleIdentifier().isEmpty()) { + if (relative && !relative->qmlModuleName().isEmpty()) { const DocNode* dn = i.value(); InnerNode* parent = dn->parent(); if (parent && parent->type() == Node::Document && parent->subType() == Node::Collision) { const NodeList& nl = parent->childNodes(); NodeList::ConstIterator it = nl.constBegin(); while (it != nl.constEnd()) { - if ((*it)->qmlModuleIdentifier() == relative->qmlModuleIdentifier()) { + if ((*it)->qmlModuleName() == relative->qmlModuleName()) { /* - By returning here, we avoid printing all the duplicate - header warnings, which are not really duplicates now, - because of the QML module identifier being used as a - namespace qualifier. + By returning here, we avoid printing + all the duplicate header warnings, + which are not really duplicates now, + because of the QML module name being + used as a namespace qualifier. */ dn = static_cast(*it); return dn; diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp index 5dd8540595..113220059c 100644 --- a/src/tools/qdoc/tree.cpp +++ b/src/tools/qdoc/tree.cpp @@ -171,7 +171,7 @@ const Node* Tree::findNode(const QStringList& path, || ((FunctionNode*)node)->metaness() == FunctionNode::MacroWithoutParams)) { if ((node != self) && (node->type() != Node::QmlPropertyGroup)) { if (node->subType() == Node::Collision) { - node = node->applyModuleIdentifier(start); + node = node->applyModuleName(start); } return node; } -- cgit v1.2.3