From 7f12b9da186f6e44f1897679339d3abc290c9534 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Thu, 29 Jan 2015 14:06:34 +0100 Subject: qdoc: Omit output subdirectory from paths written to .qhp When writing the help project file, all the files can be assumed to be in the same subdirectory, defined by the qhp virtualFolder variable in the documentation config. Since commit 77165553, the output subdirectory is stored for each documentation node, which caused the subdir to be written to paths in .qhp as well. The result was duplication of the subdir in paths passed to Assistant, giving page not found errors. Change-Id: I69fd74874f9d8eac6957287941193917728476fd Reviewed-by: Martin Smith Reviewed-by: Venugopal Shivashankar --- src/tools/qdoc/helpprojectwriter.cpp | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/tools/qdoc/helpprojectwriter.cpp b/src/tools/qdoc/helpprojectwriter.cpp index 49465304f0..5eab0155bb 100644 --- a/src/tools/qdoc/helpprojectwriter.cpp +++ b/src/tools/qdoc/helpprojectwriter.cpp @@ -224,7 +224,7 @@ QStringList HelpProjectWriter::keywordDetails(const Node *node) const details << node->name(); details << node->name(); } - details << gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()); + details << gen_->fullDocumentLocation(node, false); return details; } @@ -293,12 +293,12 @@ bool HelpProjectWriter::generateSection(HelpProject &project, QStringList details; details << keyword->string() << keyword->string() - << gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()) + + << gen_->fullDocumentLocation(node, false) + QLatin1Char('#') + Doc::canonicalTitle(keyword->string()); project.keywords.append(details); } else - node->doc().location().warning(tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()))); + node->doc().location().warning(tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node, false))); } } project.keywords.append(keywordDetails(node)); @@ -325,7 +325,7 @@ bool HelpProjectWriter::generateSection(HelpProject &project, details << item.name(); // "name" details << item.name(); // "id" } - details << gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()); + details << gen_->fullDocumentLocation(node, false); project.keywords.append(details); } } @@ -343,13 +343,13 @@ bool HelpProjectWriter::generateSection(HelpProject &project, QStringList details; details << keyword->string() << keyword->string() - << gen_->fullDocumentLocation(node, Generator::useOutputSubdirs()) + + << gen_->fullDocumentLocation(node, false) + QLatin1Char('#') + Doc::canonicalTitle(keyword->string()); project.keywords.append(details); } else cn->doc().location().warning( - tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node,Generator::useOutputSubdirs())) + tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node, false)) ); } } @@ -397,7 +397,7 @@ bool HelpProjectWriter::generateSection(HelpProject &project, // Use the location of any associated enum node in preference // to that of the typedef. if (enumNode) - typedefDetails[2] = gen_->fullDocumentLocation(enumNode,Generator::useOutputSubdirs()); + typedefDetails[2] = gen_->fullDocumentLocation(enumNode, false); project.keywords.append(typedefDetails); } @@ -424,12 +424,12 @@ bool HelpProjectWriter::generateSection(HelpProject &project, QStringList details; details << keyword->string() << keyword->string() - << gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()) + + << gen_->fullDocumentLocation(node, false) + QLatin1Char('#') + Doc::canonicalTitle(keyword->string()); project.keywords.append(details); } else docNode->doc().location().warning( - tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node,Generator::useOutputSubdirs())) + tr("Bad keyword in %1").arg(gen_->fullDocumentLocation(node, false)) ); } } @@ -554,7 +554,7 @@ void HelpProjectWriter::writeSection(QXmlStreamWriter &writer, const QString &pa void HelpProjectWriter::addMembers(HelpProject &project, QXmlStreamWriter &writer, const Node *node) { - QString href = gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()); + QString href = gen_->fullDocumentLocation(node, false); href = href.left(href.size()-5); if (href.isEmpty()) return; @@ -583,7 +583,7 @@ void HelpProjectWriter::addMembers(HelpProject &project, QXmlStreamWriter &write void HelpProjectWriter::writeNode(HelpProject &project, QXmlStreamWriter &writer, const Node *node) { - QString href = gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()); + QString href = gen_->fullDocumentLocation(node, false); QString objName = node->name(); switch (node->type()) { @@ -700,7 +700,7 @@ void HelpProjectWriter::generateProject(HelpProject &project) node = qdb_->findNodeByNameAndType(QStringList("index.html"), Node::Document); QString indexPath; if (node) - indexPath = gen_->fullDocumentLocation(node,Generator::useOutputSubdirs()); + indexPath = gen_->fullDocumentLocation(node, false); else indexPath = "index.html"; writer.writeAttribute("ref", indexPath); @@ -742,8 +742,7 @@ void HelpProjectWriter::generateProject(HelpProject &project) const Node *page = qdb_->findNodeForTarget(atom->string(), 0); writer.writeStartElement("section"); - QString indexPath = gen_->fullDocumentLocation(page, - Generator::useOutputSubdirs()); + QString indexPath = gen_->fullDocumentLocation(page, false); writer.writeAttribute("ref", indexPath); writer.writeAttribute("title", atom->string()); @@ -768,7 +767,7 @@ void HelpProjectWriter::generateProject(HelpProject &project) if (!name.isEmpty()) { writer.writeStartElement("section"); QString indexPath = gen_->fullDocumentLocation(qdb_->findNodeForTarget(subproject.indexTitle, 0), - Generator::useOutputSubdirs()); + false); writer.writeAttribute("ref", indexPath); writer.writeAttribute("title", subproject.title); } -- cgit v1.2.3