}
}
else if (command == COMMAND_EXTERNALPAGE) {
- return new FakeNode(tree_->root(), arg.first, Node::ExternalPage, Node::ArticlePage);
+ FakeNode* fn = new FakeNode(tree_->root(), arg.first, Node::ExternalPage, Node::ArticlePage);
+ fn->setLocation(arg.second);
+ return fn;
}
else if (command == COMMAND_FILE) {
- return new FakeNode(tree_->root(), arg.first, Node::File, Node::NoPageType);
+ FakeNode* fn = new FakeNode(tree_->root(), arg.first, Node::File, Node::NoPageType);
+ fn->setLocation(arg.second);
+ return fn;
}
else if (command == COMMAND_GROUP) {
- return new FakeNode(tree_->root(), arg.first, Node::Group, Node::OverviewPage);
+ FakeNode* fn = new FakeNode(tree_->root(), arg.first, Node::Group, Node::OverviewPage);
+ fn->setLocation(arg.second);
+ return fn;
}
else if (command == COMMAND_HEADERFILE) {
- return new FakeNode(tree_->root(), arg.first, Node::HeaderFile, Node::ApiPage);
+ FakeNode* fn = new FakeNode(tree_->root(), arg.first, Node::HeaderFile, Node::ApiPage);
+ fn->setLocation(arg.second);
+ return fn;
}
else if (command == COMMAND_MODULE) {
- return new FakeNode(tree_->root(), arg.first, Node::Module, Node::OverviewPage);
+ FakeNode* fn = new FakeNode(tree_->root(), arg.first, Node::Module, Node::OverviewPage);
+ fn->setLocation(arg.second);
+ return fn;
}
else if (command == COMMAND_QMLMODULE) {
- return FakeNode::lookupQmlModuleNode(tree_, arg);
+ FakeNode* fn = FakeNode::lookupQmlModuleNode(tree_, arg);
+ fn->setLocation(arg.second);
+ return fn;
}
else if (command == COMMAND_PAGE) {
Node::PageType ptype = Node::ArticlePage;
}
else if (command == COMMAND_DITAMAP) {
FakeNode* fn = new DitaMapNode(tree_->root(), arg.first);
+ fn->setLocation(arg.second);
return fn;
}
else if (command == COMMAND_QMLCLASS) {
return qcn;
}
else if (command == COMMAND_QMLBASICTYPE) {
- return new QmlBasicTypeNode(tree_->root(), arg.first);
+ QmlBasicTypeNode* n = new QmlBasicTypeNode(tree_->root(), arg.first);
+ n->setLocation(arg.second);
+ return n;
}
else if ((command == COMMAND_QMLSIGNAL) ||
(command == COMMAND_QMLMETHOD) ||
QString module;
QString element;
QString type;
- if (splitQmlMethodArg(doc,arg.first,type,module,element)) {
+ if (splitQmlMethodArg(arg.first,type,module,element)) {
QmlClassNode* qmlClass = tree_->findQmlClassNode(module,element);
if (qmlClass) {
+ bool attached = false;
+ Node::Type nodeType = Node::QmlMethod;
if (command == COMMAND_QMLSIGNAL)
- return makeFunctionNode(doc,
- arg.first,
- qmlClass,
- Node::QmlSignal,
- false,
- COMMAND_QMLSIGNAL);
- else if (command == COMMAND_QMLATTACHEDSIGNAL)
- return makeFunctionNode(doc,
- arg.first,
- qmlClass,
- Node::QmlSignal,
- true,
- COMMAND_QMLATTACHEDSIGNAL);
+ nodeType = Node::QmlSignal;
+ else if (command == COMMAND_QMLATTACHEDSIGNAL) {
+ nodeType = Node::QmlSignal;
+ attached = true;
+ }
else if (command == COMMAND_QMLMETHOD) {
- return makeFunctionNode(doc,
- arg.first,
- qmlClass,
- Node::QmlMethod,
- false,
- COMMAND_QMLMETHOD);
+ // do nothing
}
else if (command == COMMAND_QMLATTACHEDMETHOD)
- return makeFunctionNode(doc,
- arg.
- first,
- qmlClass,
- Node::QmlMethod,
- true,
- COMMAND_QMLATTACHEDMETHOD);
+ attached = true;
else
return 0; // never get here.
+ FunctionNode* fn = makeFunctionNode(doc,
+ arg.first,
+ qmlClass,
+ nodeType,
+ attached,
+ command);
+ if (fn)
+ fn->setLocation(arg.second);
+ return fn;
}
}
}
\note The two elements \e{Component} and \e{QtObject} never
have a module qualifier.
*/
-bool CppCodeParser::splitQmlPropertyArg(const Doc& doc,
- const QString& arg,
+bool CppCodeParser::splitQmlPropertyArg(const QString& arg,
QString& type,
QString& module,
QString& element,
return true;
}
QString msg = "Unrecognizable QML module/component qualifier for " + arg;
- doc.location().warning(tr(msg.toLatin1().data()));
+ location().warning(tr(msg.toLatin1().data()));
}
else {
QString msg = "Missing property type for " + arg;
- doc.location().warning(tr(msg.toLatin1().data()));
+ location().warning(tr(msg.toLatin1().data()));
}
return false;
}
\note The two elements \e{Component} and \e{QtObject} never
have a module qualifier.
*/
-bool CppCodeParser::splitQmlMethodArg(const Doc& doc,
- const QString& arg,
+bool CppCodeParser::splitQmlMethodArg(const QString& arg,
QString& type,
QString& module,
QString& element)
return true;
}
QString msg = "Unrecognizable QML module/component qualifier for " + arg;
- doc.location().warning(tr(msg.toLatin1().data()));
+ location().warning(tr(msg.toLatin1().data()));
return false;
}
Currently, this function is called only for \e{qmlproperty}
and \e{qmlattachedproperty}.
*/
-Node *CppCodeParser::processTopicCommandGroup(const Doc& doc,
- const QString& command,
- const ArgList& args)
+Node *CppCodeParser::processTopicCommandGroup(const QString& command, const ArgList& args)
{
QmlPropGroupNode* qmlPropGroup = 0;
if ((command == COMMAND_QMLPROPERTY) ||
bool attached = (command == COMMAND_QMLATTACHEDPROPERTY);
ArgList::ConstIterator argsIter = args.begin();
arg = argsIter->first;
- if (splitQmlPropertyArg(doc,arg,type,module,element,property)) {
+ if (splitQmlPropertyArg(arg,type,module,element,property)) {
QmlClassNode* qmlClass = tree_->findQmlClassNode(module,element);
if (qmlClass) {
qmlPropGroup = new QmlPropGroupNode(qmlClass,property); //,attached);
++argsIter;
while (argsIter != args.end()) {
arg = argsIter->first;
- if (splitQmlPropertyArg(doc,arg,type,module,element,property)) {
+ if (splitQmlPropertyArg(arg,type,module,element,property)) {
QmlPropertyNode* qmlPropNode = new QmlPropertyNode(qmlPropGroup,
property,
type,
if ((topic == COMMAND_QMLPROPERTY) ||
(topic == COMMAND_QMLATTACHEDPROPERTY)) {
Doc nodeDoc = doc;
- Node *node = processTopicCommandGroup(nodeDoc,topic,args);
+ Node *node = processTopicCommandGroup(topic,args);
if (node != 0) {
nodes.append(node);
docs.append(nodeDoc);
/*!
This function searches for a node with the specified \a title.
- If \a relative is provided, use it to disambiguate if it has a
- QML module identifier.
+ If \a relative node is provided, it is used to disambiguate if
+ it has a QML module identifier.
*/
const FakeNode* Tree::findFakeNodeByTitle(const QString& title, const Node* relative ) const
{
QList<Location> internalLocations;
while (j != priv->fakeNodesByTitle.constEnd()) {
if (j.key() == i.key() && j.value()->url().isEmpty())
- internalLocations.append(j.value()->doc().location());
+ internalLocations.append(j.value()->location());
++j;
}
if (internalLocations.size() > 0) {
- i.value()->doc().location().warning(
- tr("Page '%1' defined in more than one location:").arg(title));
+ i.value()->location().warning(tr("This page exists in more than one file: \"%1\"").arg(title));
foreach (const Location &location, internalLocations)
- location.warning(tr("(defined here)"));
+ location.warning(tr("[It also exists here]"));
}
}
return i.value();
}
/*!
+ This function adds the \a group name to the list of groups
+ for the \a node name. It also adds the \a node to the \a group.
*/
void Tree::addToPublicGroup(Node* node, const QString& group)
{
}
/*!
+ Returns the public group map.
*/
QMultiMap<QString, QString> Tree::publicGroups() const
{