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 <martin.smith@digia.com>
This commit is contained in:
Martin Smith 2013-10-02 12:51:45 +02:00 committed by The Qt Project
parent c97e369e70
commit c025d49119
7 changed files with 35 additions and 34 deletions

View File

@ -6109,8 +6109,8 @@ void DitaXmlGenerator::generateCollisionPages()
for (int i=0; i<collisions.size(); ++i) {
Node* n = collisions.at(i);
QString t;
if (!n->qmlModuleIdentifier().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);

View File

@ -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 +

View File

@ -1350,8 +1350,8 @@ void HtmlGenerator::generateCollisionPages()
for (int i=0; i<collisions.size(); ++i) {
Node* n = collisions.at(i);
QString t;
if (!n->qmlModuleIdentifier().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() << "<li>";
out() << "<a href=\"" << link << "\">";

View File

@ -130,8 +130,8 @@ QString Node::fullName(const Node* relative) const
if (type() == Node::Document) {
const DocNode* dn = static_cast<const DocNode*>(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;

View File

@ -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<QString,QString>& linkTargets() const { return targets; }

View File

@ -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; i<bestTargetList.size(); ++i) {
const Node* n = bestTargetList.at(i).node_;
if (n && relative->qmlModuleIdentifier() == 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<const DocNode*>(*it);
return dn;

View File

@ -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;
}