summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2014-08-22 10:04:10 +0200
committerTopi Reiniƶ <topi.reinio@digia.com>2014-08-26 20:08:58 +0200
commit15c32361d9469138edda9c6c7d9b3d3663081820 (patch)
tree49511b396f722bb3a9fbb00abb1f5b52a22203d2 /src
parentd28e2e225c140d4bcae5baabb768683fd5f9a692 (diff)
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 <jerome.pasion@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/tools/qdoc/generator.cpp2
-rw-r--r--src/tools/qdoc/qdocdatabase.cpp6
2 files changed, 6 insertions, 2 deletions
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 {