summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2018-01-10 13:52:30 +0100
committerTopi Reiniƶ <topi.reinio@qt.io>2018-01-10 14:20:32 +0000
commit58f0987e16ac4580d9e4a6b604dd7603510b0385 (patch)
tree16a7ed43831853cf9bfaa610d68d5f60eca199e2
parent7dcb77238f98709469551d4691f1ad6de442eb0e (diff)
downloadqttools-58f0987e16ac4580d9e4a6b604dd7603510b0385.tar.gz
qdoc: Always set the URL for nodes read from index
Items written to index have the URL attribute set, but qdoc only used it if it was able to resolve the relative index URL. If the documentation was generated using a single-directory output config, the relative index URL is an empty string (which is correct). But even in that case, we need to set the href (filename + anchor) as the node's URL. Change-Id: If17cb9a42663b7d6f8f1444094129d5052699fbd Reviewed-by: Martin Smith <martin.smith@qt.io>
-rw-r--r--src/qdoc/qdocindexfiles.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qdoc/qdocindexfiles.cpp b/src/qdoc/qdocindexfiles.cpp
index 4918fe795..22db2e3a7 100644
--- a/src/qdoc/qdocindexfiles.cpp
+++ b/src/qdoc/qdocindexfiles.cpp
@@ -610,9 +610,9 @@ void QDocIndexFiles::readIndexSection(QXmlStreamReader& reader,
if (!physicalModuleName.isEmpty())
qdb_->addToModule(physicalModuleName, node);
if (!href.isEmpty()) {
- if (node->isExternalPage())
- node->setUrl(href);
- else if (!indexUrl.isEmpty())
+ node->setUrl(href);
+ // Include the index URL if it exists
+ if (!node->isExternalPage() && !indexUrl.isEmpty())
node->setUrl(indexUrl + QLatin1Char('/') + href);
}