qdoc: Replaced hard-coded href with computed href

For enum types that have QFlags versions, qdoc was
outputting the documentation with a hard-coded link
to qflags.html, which only workjed in the single
directory mode. When qdoc outputs modular documentation,
the href for the link should be "../qtcore/qflags.html" .
Now qdoc computes this href correctly before it writes
the docs. The href is no longer hard-coded.

Task-number: QTBUG-35209
Change-Id: Ibdf5b11dbd063726eb77048de78f8874c65752ca
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
Martin Smith 2013-12-02 10:46:21 +01:00 committed by The Qt Project
parent 119ea0f2db
commit 1fc28716e6
2 changed files with 5 additions and 1 deletions

View File

@ -269,6 +269,9 @@ QString HtmlGenerator::format()
void HtmlGenerator::generateTree()
{
qdb_->buildCollections();
Node* qflags = qdb_->findNodeByNameAndType(QStringList("QFlags"), Node::Class, Node::NoSubType);
if (qflags)
qflagsHref_ = linkForNode(qflags,0);
if (!runPrepareOnly()) {
Generator::generateTree();
generateCollisionPages();
@ -3660,7 +3663,7 @@ void HtmlGenerator::generateDetailedMember(const Node *node,
if (enume->flagsType()) {
out() << "<p>The " << protectEnc(enume->flagsType()->name())
<< " type is a typedef for "
<< "<a href=\"qflags.html\">QFlags</a>&lt;"
<< "<a href=\"" << qflagsHref_ << "\">QFlags</a>&lt;"
<< protectEnc(enume->name())
<< "&gt;. It stores an OR combination of "
<< protectEnc(enume->name())

View File

@ -262,6 +262,7 @@ private:
QString cppclassespage;
QString qmltypespage;
QString buildversion;
QString qflagsHref_;
public:
static bool debugging_on;