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 <martin.smith@digia.com>
bb10
Martin Smith 2015-01-27 12:03:33 +01:00
parent 7708c4b854
commit 699efbe862
7 changed files with 73 additions and 73 deletions

View File

@ -146,7 +146,7 @@ public:
virtual QList<Section> sections(const InnerNode *inner,
SynopsisStyle style,
Status status) = 0;
virtual QList<Section> qmlSections(QmlTypeNode* qmlClassNode,
virtual QList<Section> qmlSections(QmlTypeNode* qmlTypeNode,
SynopsisStyle style,
Status status = Okay);
virtual QStringList macRefsForNode(Node* node);

View File

@ -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<Section> CppCodeMarker::qmlSections(QmlTypeNode* qmlClassNode, SynopsisStyle style, Status status)
QList<Section> CppCodeMarker::qmlSections(QmlTypeNode* qmlTypeNode, SynopsisStyle style, Status status)
{
QList<Section> 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<Section> 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<Section> 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

View File

@ -70,7 +70,7 @@ public:
virtual QList<Section> sections(const InnerNode *innerNode,
SynopsisStyle style,
Status status) Q_DECL_OVERRIDE;
virtual QList<Section> qmlSections(QmlTypeNode* qmlClassNode,
virtual QList<Section> qmlSections(QmlTypeNode* qmlTypeNode,
SynopsisStyle style,
Status status = Okay) Q_DECL_OVERRIDE;

View File

@ -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 <QML-module> 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 <QML-module> 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,
<type> <QML-module>::<QML-type>::<name>(<param>, <param>, ...)
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<QmlTypeNode*>(node);
qmlClass->setQmlBaseName(arg);
QmlTypeNode* qmlType = static_cast<QmlTypeNode*>(node);
qmlType->setQmlBaseName(arg);
QmlTypeNode::addInheritedBy(arg,node);
}
}

View File

@ -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()) {

View File

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

View File

@ -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<QmlTypeNode*>(node);
qmlClass->setQmlBaseName(args[0].first);
QmlTypeNode *qmlType = static_cast<QmlTypeNode*>(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<QmlTypeNode *>(current);
if (qmlClass) {
QmlTypeNode *qmlType = static_cast<QmlTypeNode *>(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<QmlTypeNode *>(current);
if (qmlClass) {
QmlTypeNode *qmlType = static_cast<QmlTypeNode *>(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<QmlTypeNode*>(current);
if (qmlClass) {
QmlTypeNode* qmlType = static_cast<QmlTypeNode*>(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<QmlTypeNode*>(current);
if (qmlClass) {
QmlTypeNode* qmlType = static_cast<QmlTypeNode*>(current);
if (qmlType) {
FunctionNode* qmlSH = new FunctionNode(Node::QmlSignalHandler,current,handler,false);
applyDocumentation(sb->firstSourceLocation(), qmlSH);
}