diff options
Diffstat (limited to 'src/tools/qdoc/qdocindexfiles.cpp')
-rw-r--r-- | src/tools/qdoc/qdocindexfiles.cpp | 59 |
1 files changed, 40 insertions, 19 deletions
diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp index 5f2ebdfd07..3283e978f4 100644 --- a/src/tools/qdoc/qdocindexfiles.cpp +++ b/src/tools/qdoc/qdocindexfiles.cpp @@ -133,7 +133,8 @@ void QDocIndexFiles::readIndexFile(const QString& path) else { // Use a fake directory, since we will copy the output to a sub directory of // installDir when using "make install". This is just for a proper relative path. - QDir installDir(path.section('/', 0, -3) + "/outputdir"); + //QDir installDir(path.section('/', 0, -3) + "/outputdir"); + QDir installDir(path.section('/', 0, -3) + '/' + Generator::outputSubdir()); indexUrl = installDir.relativeFilePath(path).section('/', 0, -2); } project_ = indexElement.attribute("project", QString()); @@ -217,8 +218,18 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element, location = Location(name); node = qbtn; } - else if (element.nodeName() == "qmlproperty") { + else if (element.nodeName() == "qmlpropertygroup") { QmlClassNode* qcn = static_cast<QmlClassNode*>(parent); + QmlPropertyGroupNode* qpgn = new QmlPropertyGroupNode(qcn, name); + if (element.hasAttribute("location")) + name = element.attribute("location", QString()); + if (!indexUrl.isEmpty()) + location = Location(indexUrl + QLatin1Char('/') + name); + else if (!indexUrl.isNull()) + location = Location(name); + node = qpgn; + } + else if (element.nodeName() == "qmlproperty") { QString type = element.attribute("type"); bool attached = false; if (element.attribute("attached") == "true") @@ -226,7 +237,15 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element, bool readonly = false; if (element.attribute("writable") == "false") readonly = true; - QmlPropertyNode* qpn = new QmlPropertyNode(qcn, name, type, attached); + QmlPropertyNode* qpn = 0; + if (parent->type() == Node::Document) { + QmlClassNode* qcn = static_cast<QmlClassNode*>(parent); + qpn = new QmlPropertyNode(qcn, name, type, attached); + } + else if (parent->type() == Node::QmlPropertyGroup) { + QmlPropertyGroupNode* qpgn = static_cast<QmlPropertyGroupNode*>(parent); + qpn = new QmlPropertyNode(qpgn, name, type, attached); + } qpn->setReadOnly(readonly); node = qpn; } @@ -281,10 +300,6 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element, subtype = Node::QmlClass; ptype = Node::ApiPage; } - else if (element.attribute("subtype") == "qmlpropertygroup") { - subtype = Node::QmlPropertyGroup; - ptype = Node::ApiPage; - } else if (element.attribute("subtype") == "qmlbasictype") { subtype = Node::QmlBasicType; ptype = Node::ApiPage; @@ -501,7 +516,7 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element, // Create some content for the node. QSet<QString> emptySet; - Doc doc(location, location, " ", emptySet); // placeholder + Doc doc(location, location, " ", emptySet, emptySet); // placeholder node->setDoc(doc); node->setIndexNodeFlag(); node->setOutputSubdirectory(project_.toLower()); @@ -644,6 +659,9 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, case Node::QmlProperty: nodeName = "qmlproperty"; break; + case Node::QmlPropertyGroup: + nodeName = "qmlpropertygroup"; + break; case Node::QmlSignal: nodeName = "qmlsignal"; break; @@ -746,7 +764,9 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, QString fullName = node->fullDocumentName(); if (fullName != objName) writer.writeAttribute("fullname", fullName); - QString href = node->outputSubdirectory(); + QString href; + if (Generator::useOutputSubdirs()) + href = node->outputSubdirectory(); if (!href.isEmpty()) href.append(QLatin1Char('/')); href.append(gen_->fullDocumentLocation(node)); @@ -927,6 +947,12 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, writer.writeAttribute("brief", brief); } break; + case Node::QmlPropertyGroup: + { + if (!brief.isEmpty()) + writer.writeAttribute("brief", brief); + } + break; case Node::Property: { const PropertyNode* propertyNode = static_cast<const PropertyNode*>(node); @@ -1179,17 +1205,12 @@ void QDocIndexFiles::generateIndexSections(QXmlStreamWriter& writer, foreach (Node* child, cnodes) { /* - Don't generate anything for a QML property group node. - It is just a place holder for a collection of QML property - nodes. Recurse to its children, which are the QML property - nodes. - - Do the same thing for collision nodes - we want children - of collision nodes in the index, but leaving out the - parent collision page will make searching for nodes easier. + Don't generate anything for a collision node. We want + children of collision nodes in the index, but leaving + out the parent collision page will make searching for + nodes easier. */ - if (child->subType() == Node::QmlPropertyGroup || - child->subType() == Node::Collision) { + if (child->subType() == Node::Collision) { const InnerNode* pgn = static_cast<const InnerNode*>(child); foreach (Node* c, pgn->childNodes()) { generateIndexSections(writer, c, generateInternalNodes); |