From 15c32361d9469138edda9c6c7d9b3d3663081820 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 22 Aug 2014 10:04:10 +0200 Subject: qdoc: Enable listing of example files with .html extension If a (non-external) link string ends in '.html', qdoc assumed it is a direct link to a generated html page. However, it could also refer to an example file with .html extension. This commit fixes a corner case where links to an example file page were broken for such files. Task-number: QTBUG-40831 Change-Id: I31acc141970b6768f0a93964723be82611d37a3d Reviewed-by: Jerome Pasion --- src/tools/qdoc/generator.cpp | 2 +- src/tools/qdoc/qdocdatabase.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/tools') diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp index 75faaf7c6c..f96ca490f9 100644 --- a/src/tools/qdoc/generator.cpp +++ b/src/tools/qdoc/generator.cpp @@ -316,7 +316,7 @@ QString Generator::fileBase(const Node *node) const QString base; if (node->isDocNode()) { base = node->name(); - if (base.endsWith(".html")) + if (base.endsWith(".html") && !node->isExampleFile()) base.truncate(base.length() - 5); if (node->isExample() || node->isExampleFile()) { diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp index ffac23aae0..d06cb659c4 100644 --- a/src/tools/qdoc/qdocdatabase.cpp +++ b/src/tools/qdoc/qdocdatabase.cpp @@ -1627,8 +1627,12 @@ const Node* QDocDatabase::findNodeForAtom(const Atom* atom, const Node* relative } } else { - if (first.endsWith(".html")) + if (first.endsWith(".html")) { node = findNodeByNameAndType(QStringList(first), Node::Document); + // the path may also refer to an example file with .html extension + if (!node && first.contains("/")) + return findNodeForTarget(targetPath, relative, genus, ref); + } else if (first.endsWith("()")) node = findFunctionNode(first, relative, genus); else { -- cgit v1.2.3