diff options
author | Martin Smith <martin.smith@digia.com> | 2013-09-20 13:39:08 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-23 12:36:55 +0200 |
commit | f5b3224cb5321b8b3ffefff13f547fbe81ea0c7c (patch) | |
tree | 3bf269e09c2819a90f8e0fb7b3297153a1d7ae7d /src/tools | |
parent | 2d00d3951d9384c848794ac9dd783986165eef8f (diff) |
qdoc: \externalpage links are fixed
The problem was they were being incorrectly written to
and read from the index files.
Task-number: QTBUG-33510
Change-Id: Ib0b34265cd22fff5ed88ae2fd5d5d7ea58b3761d
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/qdoc/htmlgenerator.cpp | 4 | ||||
-rw-r--r-- | src/tools/qdoc/node.h | 2 | ||||
-rw-r--r-- | src/tools/qdoc/qdocindexfiles.cpp | 26 |
3 files changed, 21 insertions, 11 deletions
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 1c28ede976..ac10bb94e3 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -3605,8 +3605,10 @@ QString HtmlGenerator::linkForNode(const Node *node, const Node *relative) back down into the other subdirectory. */ if (node && relative && (node != relative)) { - if (useOutputSubdirs() && node->outputSubdirectory() != relative->outputSubdirectory()) + if (useOutputSubdirs() && !node->isExternalPage() && + node->outputSubdirectory() != relative->outputSubdirectory()) { link.prepend(QString("../" + node->outputSubdirectory() + QLatin1Char('/'))); + } } return link; } diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h index 76e762120e..f1d9931a08 100644 --- a/src/tools/qdoc/node.h +++ b/src/tools/qdoc/node.h @@ -211,6 +211,7 @@ public: virtual bool isWrapper() const; virtual bool isReadOnly() const { return false; } virtual bool isDefault() const { return false; } + virtual bool isExternalPage() const { return false; } virtual void addMember(Node* ) { } virtual bool hasMembers() const { return false; } virtual bool hasNamespaces() const { return false; } @@ -514,6 +515,7 @@ public: virtual bool isGroup() const { return (subType() == Node::Group); } virtual bool isExample() const { return (subType() == Node::Example); } virtual bool isExampleFile() const { return (parent() && parent()->isExample()); } + virtual bool isExternalPage() const { return nodeSubtype_ == ExternalPage; } protected: SubType nodeSubtype_; diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp index d8cb42513e..bef22631f0 100644 --- a/src/tools/qdoc/qdocindexfiles.cpp +++ b/src/tools/qdoc/qdocindexfiles.cpp @@ -499,9 +499,10 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element, QString moduleName = element.attribute("module"); if (!moduleName.isEmpty()) node->setModuleName(moduleName); - if (!indexUrl.isEmpty()) { + if (node->isExternalPage()) + node->setUrl(href); + else if (!indexUrl.isEmpty()) node->setUrl(indexUrl + QLatin1Char('/') + href); - } QString since = element.attribute("since"); if (!since.isEmpty()) { @@ -776,15 +777,20 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, if (!qmlFullBaseName.isEmpty()) writer.writeAttribute("qml-base-type", qmlFullBaseName); } - QString fullName = node->fullDocumentName(); - if (fullName != objName) - writer.writeAttribute("fullname", fullName); + QString href; - if (Generator::useOutputSubdirs()) - href = node->outputSubdirectory(); - if (!href.isEmpty()) - href.append(QLatin1Char('/')); - href.append(gen_->fullDocumentLocation(node)); + if (!node->isExternalPage()) { + QString fullName = node->fullDocumentName(); + if (fullName != objName) + writer.writeAttribute("fullname", fullName); + if (Generator::useOutputSubdirs()) + href = node->outputSubdirectory(); + if (!href.isEmpty()) + href.append(QLatin1Char('/')); + href.append(gen_->fullDocumentLocation(node)); + } + else + href = node->name(); writer.writeAttribute("href", href); writer.writeAttribute("location", node->location().fileName()); |