From f5b3224cb5321b8b3ffefff13f547fbe81ea0c7c Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 20 Sep 2013 13:39:08 +0200 Subject: 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 --- src/tools/qdoc/qdocindexfiles.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'src/tools/qdoc/qdocindexfiles.cpp') diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp index d8cb42513e1..bef22631f09 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()); -- cgit v1.2.3