From 699efbe862efca5a0d18599dbc8a09d6e4cd0e9f Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 27 Jan 2015 12:03:33 +0100 Subject: qdoc: Change remaining uses of qmlClass to qmlType After changing the class name QmlClassNode to QmlTypeNode, there remained several local variables that still used the name qmlClass. These are now changed to qmlType. There were also some uses of qmlType that were QString variables. These have been changed to qmlTypeName. Change-Id: I18fb05d4d8aeb1e36acabc4574c62c55a44f339a Task-number: QTBUG-43715 Reviewed-by: Martin Smith --- src/tools/qdoc/codemarker.h | 2 +- src/tools/qdoc/cppcodemarker.cpp | 42 ++++++++++++------------- src/tools/qdoc/cppcodemarker.h | 2 +- src/tools/qdoc/cppcodeparser.cpp | 66 ++++++++++++++++++++-------------------- src/tools/qdoc/node.cpp | 6 ++-- src/tools/qdoc/node.h | 4 +-- src/tools/qdoc/qmlvisitor.cpp | 24 +++++++-------- 7 files changed, 73 insertions(+), 73 deletions(-) diff --git a/src/tools/qdoc/codemarker.h b/src/tools/qdoc/codemarker.h index c056906893..8c71e9e369 100644 --- a/src/tools/qdoc/codemarker.h +++ b/src/tools/qdoc/codemarker.h @@ -146,7 +146,7 @@ public: virtual QList
sections(const InnerNode *inner, SynopsisStyle style, Status status) = 0; - virtual QList
qmlSections(QmlTypeNode* qmlClassNode, + virtual QList
qmlSections(QmlTypeNode* qmlTypeNode, SynopsisStyle style, Status status = Okay); virtual QStringList macRefsForNode(Node* node); diff --git a/src/tools/qdoc/cppcodemarker.cpp b/src/tools/qdoc/cppcodemarker.cpp index c3c486e009..7dec0ab0d1 100644 --- a/src/tools/qdoc/cppcodemarker.cpp +++ b/src/tools/qdoc/cppcodemarker.cpp @@ -1083,50 +1083,50 @@ QString CppCodeMarker::addMarkUp(const QString &in, /*! This function is for documenting QML properties. It returns the list of documentation sections for the children of the - \a qmlClassNode. + \a qmlTypeNode. */ -QList
CppCodeMarker::qmlSections(QmlTypeNode* qmlClassNode, SynopsisStyle style, Status status) +QList
CppCodeMarker::qmlSections(QmlTypeNode* qmlTypeNode, SynopsisStyle style, Status status) { QList
sections; - if (qmlClassNode) { + if (qmlTypeNode) { if (style == Summary) { - FastSection qmlproperties(qmlClassNode, + FastSection qmlproperties(qmlTypeNode, "Properties", QString(), "property", "properties"); - FastSection qmlattachedproperties(qmlClassNode, + FastSection qmlattachedproperties(qmlTypeNode, "Attached Properties", QString(), "property", "properties"); - FastSection qmlsignals(qmlClassNode, + FastSection qmlsignals(qmlTypeNode, "Signals", QString(), "signal", "signals"); - FastSection qmlsignalhandlers(qmlClassNode, + FastSection qmlsignalhandlers(qmlTypeNode, "Signal Handlers", QString(), "signal handler", "signal handlers"); - FastSection qmlattachedsignals(qmlClassNode, + FastSection qmlattachedsignals(qmlTypeNode, "Attached Signals", QString(), "signal", "signals"); - FastSection qmlmethods(qmlClassNode, + FastSection qmlmethods(qmlTypeNode, "Methods", QString(), "method", "methods"); - FastSection qmlattachedmethods(qmlClassNode, + FastSection qmlattachedmethods(qmlTypeNode, "Attached Methods", QString(), "method", "methods"); - QmlTypeNode* qcn = qmlClassNode; + QmlTypeNode* qcn = qmlTypeNode; while (qcn != 0) { NodeList::ConstIterator c = qcn->childNodes().constBegin(); while (c != qcn->childNodes().constEnd()) { @@ -1181,17 +1181,17 @@ QList
CppCodeMarker::qmlSections(QmlTypeNode* qmlClassNode, SynopsisSty append(sections,qmlattachedmethods); } else if (style == Detailed) { - FastSection qmlproperties(qmlClassNode, "Property Documentation","qmlprop","member","members"); - FastSection qmlattachedproperties(qmlClassNode,"Attached Property Documentation","qmlattprop", + FastSection qmlproperties(qmlTypeNode, "Property Documentation","qmlprop","member","members"); + FastSection qmlattachedproperties(qmlTypeNode,"Attached Property Documentation","qmlattprop", "member","members"); - FastSection qmlsignals(qmlClassNode,"Signal Documentation","qmlsig","signal","signals"); - FastSection qmlsignalhandlers(qmlClassNode,"Signal Handler Documentation","qmlsighan","signal handler","signal handlers"); - FastSection qmlattachedsignals(qmlClassNode,"Attached Signal Documentation","qmlattsig", + FastSection qmlsignals(qmlTypeNode,"Signal Documentation","qmlsig","signal","signals"); + FastSection qmlsignalhandlers(qmlTypeNode,"Signal Handler Documentation","qmlsighan","signal handler","signal handlers"); + FastSection qmlattachedsignals(qmlTypeNode,"Attached Signal Documentation","qmlattsig", "signal","signals"); - FastSection qmlmethods(qmlClassNode,"Method Documentation","qmlmeth","member","members"); - FastSection qmlattachedmethods(qmlClassNode,"Attached Method Documentation","qmlattmeth", + FastSection qmlmethods(qmlTypeNode,"Method Documentation","qmlmeth","member","members"); + FastSection qmlattachedmethods(qmlTypeNode,"Attached Method Documentation","qmlattmeth", "member","members"); - QmlTypeNode* qcn = qmlClassNode; + QmlTypeNode* qcn = qmlTypeNode; while (qcn != 0) { NodeList::ConstIterator c = qcn->childNodes().constBegin(); while (c != qcn->childNodes().constEnd()) { @@ -1250,8 +1250,8 @@ QList
CppCodeMarker::qmlSections(QmlTypeNode* qmlClassNode, SynopsisSty members is prepared. */ ClassMap* classMap = 0; - FastSection all(qmlClassNode,QString(),QString(),"member","members"); - QmlTypeNode* current = qmlClassNode; + FastSection all(qmlTypeNode,QString(),QString(),"member","members"); + QmlTypeNode* current = qmlTypeNode; while (current != 0) { /* If the QML type is abstract, do not create diff --git a/src/tools/qdoc/cppcodemarker.h b/src/tools/qdoc/cppcodemarker.h index fb2b14d7a4..ebf3adbc5d 100644 --- a/src/tools/qdoc/cppcodemarker.h +++ b/src/tools/qdoc/cppcodemarker.h @@ -70,7 +70,7 @@ public: virtual QList
sections(const InnerNode *innerNode, SynopsisStyle style, Status status) Q_DECL_OVERRIDE; - virtual QList
qmlSections(QmlTypeNode* qmlClassNode, + virtual QList
qmlSections(QmlTypeNode* qmlTypeNode, SynopsisStyle style, Status status = Okay) Q_DECL_OVERRIDE; diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp index 1338417bab..5e4357f624 100644 --- a/src/tools/qdoc/cppcodeparser.cpp +++ b/src/tools/qdoc/cppcodeparser.cpp @@ -559,11 +559,11 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, (command == COMMAND_QMLATTACHEDSIGNAL) || (command == COMMAND_QMLATTACHEDMETHOD)) { QString module; - QString qmlType; + QString qmlTypeName; QString type; - if (splitQmlMethodArg(arg.first,type,module,qmlType)) { - QmlTypeNode* qmlClass = qdb_->findQmlType(module,qmlType); - if (qmlClass) { + if (splitQmlMethodArg(arg.first, type, module, qmlTypeName)) { + QmlTypeNode* qmlType = qdb_->findQmlType(module, qmlTypeName); + if (qmlType) { bool attached = false; Node::Type nodeType = Node::QmlMethod; if (command == COMMAND_QMLSIGNAL) @@ -581,7 +581,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, return 0; // never get here. FunctionNode* fn = makeFunctionNode(doc, arg.first, - qmlClass, + qmlType, nodeType, attached, command); @@ -602,19 +602,19 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, This function splits the argument into those parts. A is the QML equivalent of a C++ namespace. So this function splits \a arg on "::" and stores the - parts in \a module, \a qmlType, and \a name, and returns + parts in \a module, \a qmlTypeName, and \a name, and returns true. If any part is not found, a qdoc warning is emitted and false is returned. */ bool CppCodeParser::splitQmlPropertyGroupArg(const QString& arg, QString& module, - QString& qmlType, + QString& qmlTypeName, QString& name) { QStringList colonSplit = arg.split("::"); if (colonSplit.size() == 3) { module = colonSplit[0]; - qmlType = colonSplit[1]; + qmlTypeName = colonSplit[1]; name = colonSplit[2]; return true; } @@ -634,7 +634,7 @@ bool CppCodeParser::splitQmlPropertyGroupArg(const QString& arg, was used before the creation of Qt Quick 2 and Qt Components. A is the QML equivalent of a C++ namespace. So this function splits \a arg on "::" - and stores the parts in \a type, \a module, \a qmlType, + and stores the parts in \a type, \a module, \a qmlTypeName, and \a name, and returns \c true. If any part other than \a module is not found, a qdoc warning is emitted and false is returned. @@ -645,7 +645,7 @@ bool CppCodeParser::splitQmlPropertyGroupArg(const QString& arg, bool CppCodeParser::splitQmlPropertyArg(const QString& arg, QString& type, QString& module, - QString& qmlType, + QString& qmlTypeName, QString& name) { QStringList blankSplit = arg.split(QLatin1Char(' ')); @@ -654,13 +654,13 @@ bool CppCodeParser::splitQmlPropertyArg(const QString& arg, QStringList colonSplit(blankSplit[1].split("::")); if (colonSplit.size() == 3) { module = colonSplit[0]; - qmlType = colonSplit[1]; + qmlTypeName = colonSplit[1]; name = colonSplit[2]; return true; } if (colonSplit.size() == 2) { module.clear(); - qmlType = colonSplit[0]; + qmlTypeName = colonSplit[0]; name = colonSplit[1]; return true; } @@ -681,7 +681,7 @@ bool CppCodeParser::splitQmlPropertyArg(const QString& arg, ::::(, , ...) This function splits the argument into one of those two - forms, sets \a module, \a qmlType, and \a name, and returns + forms, sets \a module, \a qmlTypeName, and \a name, and returns true. If the argument doesn't match either form, an error message is emitted and false is returned. @@ -691,7 +691,7 @@ bool CppCodeParser::splitQmlPropertyArg(const QString& arg, bool CppCodeParser::splitQmlMethodArg(const QString& arg, QString& type, QString& module, - QString& qmlType) + QString& qmlTypeName) { QStringList colonSplit(arg.split("::")); if (colonSplit.size() > 1) { @@ -700,22 +700,22 @@ bool CppCodeParser::splitQmlMethodArg(const QString& arg, type = blankSplit[0]; if (colonSplit.size() > 2) { module = blankSplit[1]; - qmlType = colonSplit[1]; + qmlTypeName = colonSplit[1]; } else { module.clear(); - qmlType = blankSplit[1]; + qmlTypeName = blankSplit[1]; } } else { type.clear(); if (colonSplit.size() > 2) { module = colonSplit[0]; - qmlType = colonSplit[1]; + qmlTypeName = colonSplit[1]; } else { module.clear(); - qmlType = colonSplit[0]; + qmlTypeName = colonSplit[0]; } } return true; @@ -737,10 +737,10 @@ void CppCodeParser::processQmlProperties(const Doc& doc, NodeList& nodes, DocLis QString type; QString topic; QString module; - QString qmlType; + QString qmlTypeName; QString property; QmlPropertyNode* qpn = 0; - QmlTypeNode* qmlClass = 0; + QmlTypeNode* qmlType = 0; QmlPropertyGroupNode* qpgn = 0; Topic qmlPropertyGroupTopic; @@ -755,11 +755,11 @@ void CppCodeParser::processQmlProperties(const Doc& doc, NodeList& nodes, DocLis qmlPropertyGroupTopic = topics.at(0); qmlPropertyGroupTopic.topic = COMMAND_QMLPROPERTYGROUP; arg = qmlPropertyGroupTopic.args; - if (splitQmlPropertyArg(arg, type, module, qmlType, property)) { + if (splitQmlPropertyArg(arg, type, module, qmlTypeName, property)) { int i = property.indexOf('.'); if (i != -1) { property = property.left(i); - qmlPropertyGroupTopic.args = module + "::" + qmlType + "::" + property; + qmlPropertyGroupTopic.args = module + "::" + qmlTypeName + "::" + property; doc.location().warning(tr("No QML property group command found; using \\%1 %2") .arg(COMMAND_QMLPROPERTYGROUP).arg(qmlPropertyGroupTopic.args)); } @@ -775,10 +775,10 @@ void CppCodeParser::processQmlProperties(const Doc& doc, NodeList& nodes, DocLis if (!qmlPropertyGroupTopic.isEmpty()) { arg = qmlPropertyGroupTopic.args; - if (splitQmlPropertyGroupArg(arg, module, qmlType, property)) { - qmlClass = qdb_->findQmlType(module, qmlType); - if (qmlClass) { - qpgn = new QmlPropertyGroupNode(qmlClass, property); + if (splitQmlPropertyGroupArg(arg, module, qmlTypeName, property)) { + qmlType = qdb_->findQmlType(module, qmlTypeName); + if (qmlType) { + qpgn = new QmlPropertyGroupNode(qmlType, property); qpgn->setLocation(doc.startLocation()); nodes.append(qpgn); docs.append(doc); @@ -793,10 +793,10 @@ void CppCodeParser::processQmlProperties(const Doc& doc, NodeList& nodes, DocLis arg = topics.at(i).args; if ((topic == COMMAND_QMLPROPERTY) || (topic == COMMAND_QMLATTACHEDPROPERTY)) { bool attached = (topic == COMMAND_QMLATTACHEDPROPERTY); - if (splitQmlPropertyArg(arg, type, module, qmlType, property)) { - qmlClass = qdb_->findQmlType(module, qmlType); - if (qmlClass) { - if (qmlClass->hasQmlProperty(property, attached) != 0) { + if (splitQmlPropertyArg(arg, type, module, qmlTypeName, property)) { + qmlType = qdb_->findQmlType(module, qmlTypeName); + if (qmlType) { + if (qmlType->hasQmlProperty(property, attached) != 0) { QString msg = tr("QML property documented multiple times: '%1'").arg(arg); doc.startLocation().warning(msg); } @@ -805,7 +805,7 @@ void CppCodeParser::processQmlProperties(const Doc& doc, NodeList& nodes, DocLis qpn->setLocation(doc.startLocation()); } else { - qpn = new QmlPropertyNode(qmlClass, property, type, attached); + qpn = new QmlPropertyNode(qmlType, property, type, attached); qpn->setLocation(doc.startLocation()); nodes.append(qpn); docs.append(doc); @@ -932,8 +932,8 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc, if (node->name() == arg) doc.location().warning(tr("%1 tries to inherit itself").arg(arg)); else if (node->isQmlType()) { - QmlTypeNode *qmlClass = static_cast(node); - qmlClass->setQmlBaseName(arg); + QmlTypeNode* qmlType = static_cast(node); + qmlType->setQmlBaseName(arg); QmlTypeNode::addInheritedBy(arg,node); } } diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp index d9905baac3..d5282af34b 100644 --- a/src/tools/qdoc/node.cpp +++ b/src/tools/qdoc/node.cpp @@ -628,7 +628,7 @@ QString Node::guid() const If it is a child of a QML class node, return a pointer to the QML class node. Otherwise, return 0; */ -QmlTypeNode* Node::qmlClassNode() +QmlTypeNode* Node::qmlTypeNode() { if (isQmlNode()) { Node* n = this; @@ -649,7 +649,7 @@ QmlTypeNode* Node::qmlClassNode() */ ClassNode* Node::declarativeCppNode() { - QmlTypeNode* qcn = qmlClassNode(); + QmlTypeNode* qcn = qmlTypeNode(); if (qcn) return qcn->classNode(); return 0; @@ -2347,7 +2347,7 @@ bool QmlPropertyNode::isWritable() if (readOnly_ != FlagValueDefault) return !fromFlagValue(readOnly_, false); - QmlTypeNode* qcn = qmlClassNode(); + QmlTypeNode* qcn = qmlTypeNode(); if (qcn) { if (qcn->cppClassRequired()) { if (qcn->classNode()) { diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h index a60d53b1e2..8c0fc4ecde 100644 --- a/src/tools/qdoc/node.h +++ b/src/tools/qdoc/node.h @@ -107,7 +107,7 @@ public: LastSubtype }; - enum Genus { DontCare, CPP, QML, DOC }; + enum Genus { DontCare, CPP, JS, QML, DOC }; enum Access { Public, Protected, Private }; @@ -300,7 +300,7 @@ public: virtual void setClassNode(ClassNode* ) { } virtual const Node* applyModuleName(const Node* ) const { return 0; } virtual QString idNumber() { return "0"; } - QmlTypeNode* qmlClassNode(); + QmlTypeNode* qmlTypeNode(); ClassNode* declarativeCppNode(); const QString& outputSubdirectory() const { return outSubDir_; } void setOutputSubdirectory(const QString& t) { outSubDir_ = t; } diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp index a621973b81..a592560664 100644 --- a/src/tools/qdoc/qmlvisitor.cpp +++ b/src/tools/qdoc/qmlvisitor.cpp @@ -371,8 +371,8 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation, if (node->name() == args[0].first) doc.location().warning(tr("%1 tries to inherit itself").arg(args[0].first)); else if (node->isQmlType()) { - QmlTypeNode *qmlClass = static_cast(node); - qmlClass->setQmlBaseName(args[0].first); + QmlTypeNode *qmlType = static_cast(node); + qmlType->setQmlBaseName(args[0].first); QmlTypeNode::addInheritedBy(args[0].first,node); } } @@ -533,8 +533,8 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiPublicMember *member) case QQmlJS::AST::UiPublicMember::Signal: { if (current->isQmlType()) { - QmlTypeNode *qmlClass = static_cast(current); - if (qmlClass) { + QmlTypeNode *qmlType = static_cast(current); + if (qmlType) { QString name = member->name.toString(); FunctionNode *qmlSignal = new FunctionNode(Node::QmlSignal, current, name, false); @@ -556,12 +556,12 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiPublicMember *member) QString type = member->memberType.toString(); QString name = member->name.toString(); if (current->isQmlType()) { - QmlTypeNode *qmlClass = static_cast(current); - if (qmlClass) { + QmlTypeNode *qmlType = static_cast(current); + if (qmlType) { QString name = member->name.toString(); - QmlPropertyNode* qmlPropNode = qmlClass->hasQmlProperty(name); + QmlPropertyNode* qmlPropNode = qmlType->hasQmlProperty(name); if (qmlPropNode == 0) - qmlPropNode = new QmlPropertyNode(qmlClass, name, type, false); + qmlPropNode = new QmlPropertyNode(qmlType, name, type, false); qmlPropNode->setReadOnly(member->isReadonlyMember); if (member->isDefaultMember) qmlPropNode->setDefault(); @@ -600,8 +600,8 @@ bool QmlDocVisitor::visit(QQmlJS::AST::FunctionDeclaration* fd) return true; } if (current->isQmlType()) { - QmlTypeNode* qmlClass = static_cast(current); - if (qmlClass) { + QmlTypeNode* qmlType = static_cast(current); + if (qmlType) { QString name = fd->name.toString(); FunctionNode* qmlMethod = new FunctionNode(Node::QmlMethod, current, name, false); int overloads = 0; @@ -655,8 +655,8 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiScriptBinding* ) if (current->isQmlType()) { QString handler = sb->qualifiedId->name.toString(); if (handler.length() > 2 && handler.startsWith("on") && handler.at(2).isUpper()) { - QmlTypeNode* qmlClass = static_cast(current); - if (qmlClass) { + QmlTypeNode* qmlType = static_cast(current); + if (qmlType) { FunctionNode* qmlSH = new FunctionNode(Node::QmlSignalHandler,current,handler,false); applyDocumentation(sb->firstSourceLocation(), qmlSH); } -- cgit v1.2.3