diff options
Diffstat (limited to 'src/tools/qdoc/htmlgenerator.cpp')
-rw-r--r-- | src/tools/qdoc/htmlgenerator.cpp | 182 |
1 files changed, 9 insertions, 173 deletions
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 24dd31e0b5..806be0a3c6 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -1690,7 +1690,7 @@ void HtmlGenerator::generateFakeNode(FakeNode* fake, CodeMarker* marker) /*! Returns "html" for this subclass of Generator. */ -QString HtmlGenerator::fileExtension(const Node * /* node */) const +QString HtmlGenerator::fileExtension() const { return "html"; } @@ -1876,12 +1876,12 @@ void HtmlGenerator::generateHeader(const QString& title, out() << " <link rel=\"prev\" href=\"" << anchorPair.first << "\" />\n"; - navigationLinks += "[Previous: <a href=\"" + anchorPair.first + "\">"; + navigationLinks += "<a class=\"prevPage\" href=\"" + anchorPair.first + "\">"; if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) navigationLinks += protect(anchorPair.second); else navigationLinks += protect(linkPair.second); - navigationLinks += "</a>]\n"; + navigationLinks += "</a>\n"; } if (node->links().contains(Node::NextLink)) { linkPair = node->links()[Node::NextLink]; @@ -1894,12 +1894,12 @@ void HtmlGenerator::generateHeader(const QString& title, out() << " <link rel=\"next\" href=\"" << anchorPair.first << "\" />\n"; - navigationLinks += "[Next: <a href=\"" + anchorPair.first + "\">"; + navigationLinks += "<a class=\"nextPage\" href=\"" + anchorPair.first + "\">"; if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty()) navigationLinks += protect(anchorPair.second); else navigationLinks += protect(linkPair.second); - navigationLinks += "</a>]\n"; + navigationLinks += "</a>\n"; } if (node->links().contains(Node::StartLink)) { linkPair = node->links()[Node::StartLink]; @@ -2110,7 +2110,7 @@ QString HtmlGenerator::generateListOfAllMemberFile(const InnerNode *inner, if (sections.isEmpty()) return QString(); - QString fileName = fileBase(inner) + "-members." + fileExtension(inner); + QString fileName = fileBase(inner) + "-members." + fileExtension(); beginSubPage(inner, fileName); QString title = "List of All Members for " + inner->name(); generateHeader(title, inner, marker); @@ -2142,7 +2142,7 @@ QString HtmlGenerator::generateAllQmlMembersFile(const QmlClassNode* qml_cn, if (sections.isEmpty()) return QString(); - QString fileName = fileBase(qml_cn) + "-members." + fileExtension(qml_cn); + QString fileName = fileBase(qml_cn) + "-members." + fileExtension(); beginSubPage(qml_cn, fileName); QString title = "List of All Members for " + qml_cn->name(); generateHeader(title, qml_cn, marker); @@ -2181,11 +2181,11 @@ QString HtmlGenerator::generateLowStatusMemberFile(const InnerNode *inner, if (status == CodeMarker::Compat) { title = "Compatibility Members for " + inner->name(); - fileName = fileBase(inner) + "-compat." + fileExtension(inner); + fileName = fileBase(inner) + "-compat." + fileExtension(); } else { title = "Obsolete Members for " + inner->name(); - fileName = fileBase(inner) + "-obsolete." + fileExtension(inner); + fileName = fileBase(inner) + "-obsolete." + fileExtension(); } beginSubPage(inner, fileName); @@ -4319,170 +4319,6 @@ void HtmlGenerator::generateExtractionMark(const Node *node, ExtractionMarkType } } -/*! - Returns the full document location for HTML-based documentation. - */ -QString HtmlGenerator::fullDocumentLocation(const Node *node, bool subdir) -{ - if (!node) - return ""; - if (!node->url().isEmpty()) - return node->url(); - - QString parentName; - QString anchorRef; - QString fdl = ""; - - /* - If the output is being sent to subdirectories of the - output directory, and if the subdir parameter is set, - prepend the subdirectory name + '/' to the result. - */ - if (subdir) { - fdl = node->outputSubdirectory(); - if (!fdl.isEmpty()) - fdl.append(QLatin1Char('/')); - } - if (node->type() == Node::Namespace) { - - // The root namespace has no name - check for this before creating - // an attribute containing the location of any documentation. - - if (!node->fileBase().isEmpty()) - parentName = node->fileBase() + ".html"; - else - return ""; - } - else if (node->type() == Node::Fake) { - if ((node->subType() == Node::QmlClass) || - (node->subType() == Node::QmlBasicType)) { - QString fb = node->fileBase(); - if (fb.startsWith(Generator::outputPrefix(QLatin1String("QML")))) - return fb + ".html"; - else { - QString mq = ""; - if (!node->qmlModuleName().isEmpty()) { - mq = node->qmlModuleIdentifier().replace(QChar('.'),QChar('-')); - mq = mq.toLower() + "-"; - } - return fdl+ Generator::outputPrefix(QLatin1String("QML")) + mq + - node->fileBase() + QLatin1String(".html"); - } - } - else - parentName = node->fileBase() + ".html"; - } - else if (node->fileBase().isEmpty()) - return ""; - - Node *parentNode = 0; - - if ((parentNode = node->relates())) { - parentName = fullDocumentLocation(node->relates()); - } - else if ((parentNode = node->parent())) { - if (parentNode->subType() == Node::QmlPropertyGroup) { - parentNode = parentNode->parent(); - parentName = fullDocumentLocation(parentNode); - } - else - parentName = fullDocumentLocation(node->parent()); - } - - switch (node->type()) { - case Node::Class: - case Node::Namespace: - if (parentNode && !parentNode->name().isEmpty()) { - parentName.remove(".html"); - parentName += QLatin1Char('-') - + node->fileBase().toLower() + ".html"; - } else { - parentName = node->fileBase() + ".html"; - } - break; - case Node::Function: - { - /* - Functions can be destructors, overloaded, or - have associated properties. - */ - const FunctionNode *functionNode = - static_cast<const FunctionNode *>(node); - - if (functionNode->metaness() == FunctionNode::Dtor) - anchorRef = "#dtor." + functionNode->name().mid(1); - - else if (functionNode->associatedProperty()) - return fullDocumentLocation(functionNode->associatedProperty()); - - else if (functionNode->overloadNumber() > 1) - anchorRef = QLatin1Char('#') + functionNode->name() - + "-" + QString::number(functionNode->overloadNumber()); - else - anchorRef = QLatin1Char('#') + functionNode->name(); - } - - /* - Use node->name() instead of node->fileBase() as - the latter returns the name in lower-case. For - HTML anchors, we need to preserve the case. - */ - break; - case Node::Enum: - anchorRef = QLatin1Char('#') + node->name() + "-enum"; - break; - case Node::Typedef: - anchorRef = QLatin1Char('#') + node->name() + "-typedef"; - break; - case Node::Property: - anchorRef = QLatin1Char('#') + node->name() + "-prop"; - break; - case Node::QmlProperty: - anchorRef = QLatin1Char('#') + node->name() + "-prop"; - break; - case Node::QmlSignal: - anchorRef = QLatin1Char('#') + node->name() + "-signal"; - break; - case Node::QmlSignalHandler: - anchorRef = QLatin1Char('#') + node->name() + "-signal-handler"; - break; - case Node::QmlMethod: - anchorRef = QLatin1Char('#') + node->name() + "-method"; - break; - case Node::Variable: - anchorRef = QLatin1Char('#') + node->name() + "-var"; - break; - case Node::Fake: - { - /* - Use node->fileBase() for fake nodes because they are represented - by pages whose file names are lower-case. - */ - parentName = node->fileBase(); - parentName.replace(QLatin1Char('/'), "-").replace(".", "-"); - parentName += ".html"; - } - break; - default: - break; - } - - // Various objects can be compat (deprecated) or obsolete. - if (node->type() != Node::Class && node->type() != Node::Namespace) { - switch (node->status()) { - case Node::Compat: - parentName.replace(".html", "-compat.html"); - break; - case Node::Obsolete: - parentName.replace(".html", "-obsolete.html"); - break; - default: - ; - } - } - - return fdl + parentName.toLower() + anchorRef; -} /*! This function outputs one or more manifest files in XML. |