diff options
Diffstat (limited to 'src/tools/qdoc')
-rw-r--r-- | src/tools/qdoc/generator.cpp | 1 | ||||
-rw-r--r-- | src/tools/qdoc/generator.h | 3 | ||||
-rw-r--r-- | src/tools/qdoc/htmlgenerator.cpp | 23 |
3 files changed, 11 insertions, 16 deletions
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp index db531e3936..75bfa5033b 100644 --- a/src/tools/qdoc/generator.cpp +++ b/src/tools/qdoc/generator.cpp @@ -96,6 +96,7 @@ Generator::QDocPass Generator::qdocPass_ = Generator::Neither; bool Generator::qdocSingleExec_ = false; bool Generator::qdocWriteQaPages_ = false; bool Generator::useOutputSubdirs_ = true; +QmlClassNode* Generator::qmlTypeContext_ = 0; void Generator::startDebugging(const QString& message) { diff --git a/src/tools/qdoc/generator.h b/src/tools/qdoc/generator.h index b1faf02ae9..d0c38bcb40 100644 --- a/src/tools/qdoc/generator.h +++ b/src/tools/qdoc/generator.h @@ -101,6 +101,8 @@ public: static QString defaultModuleName() { return project_; } static void resetUseOutputSubdirs() { useOutputSubdirs_ = false; } static bool useOutputSubdirs() { return useOutputSubdirs_; } + static void setQmlTypeContext(QmlClassNode* t) { qmlTypeContext_ = t; } + static QmlClassNode* qmlTypeContext() { return qmlTypeContext_; } protected: virtual void beginSubPage(const InnerNode* node, const QString& fileName); @@ -221,6 +223,7 @@ private: static bool qdocSingleExec_; static bool qdocWriteQaPages_; static bool useOutputSubdirs_; + static QmlClassNode* qmlTypeContext_; void generateReimplementedFrom(const FunctionNode *func, CodeMarker *marker); diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index bb1f9cd651..22c44bd7f6 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -1532,6 +1532,7 @@ void HtmlGenerator::generateClassLikeNode(InnerNode* inner, CodeMarker* marker) */ void HtmlGenerator::generateQmlTypePage(QmlClassNode* qcn, CodeMarker* marker) { + Generator::setQmlTypeContext(qcn); SubTitleSize subTitleSize = LargeSubTitle; QList<Section>::const_iterator s; QString htmlTitle = qcn->fullTitle() + " QML Type"; @@ -1595,6 +1596,7 @@ void HtmlGenerator::generateQmlTypePage(QmlClassNode* qcn, CodeMarker* marker) ++s; } generateFooter(qcn); + Generator::setQmlTypeContext(0); } /*! @@ -3894,8 +3896,9 @@ QString HtmlGenerator::getAutoLink(const Atom *atom, const Node *relative, const QString ref; *node = qdb_->findNodeForAtom(atom, relative, ref); - if (!(*node)) + if (!(*node)) { return QString(); + } QString link = (*node)->url(); if (link.isEmpty()) { @@ -3933,21 +3936,9 @@ QString HtmlGenerator::linkForNode(const Node *node, const Node *relative) return QString(); QString fn = fileName(node); - if (node && relative && node->parent() != relative) { - if (node->parent()->isQmlType() && relative->isQmlType()) { - if (node->parent()->isAbstract()) { - /* - This is a bit of a hack. What we discover with - the three 'if' statements immediately above, - is that node's parent is marked \qmlabstract - but the link appears in a qdoc comment for a - subclass of the node's parent. This means the - link should refer to the file for the relative - node, not the file for node. - */ - fn = fileName(relative); - } - } + if (node && node->parent() && node->parent()->isQmlType() && node->parent()->isAbstract()) { + if (Generator::qmlTypeContext()) + fn = fileName(Generator::qmlTypeContext()); } QString link = fn; |