summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@digia.com>2014-03-20 13:51:35 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-31 21:05:30 +0200
commitd13d03f012b9c0516fa027f4e1ea18c12f1491ca (patch)
tree420299ff025c475353da954b78961b53c7b9ccef /src/tools/qdoc
parent2ea15849a09208ac19d189acdc51c313b64a0b3a (diff)
qdoc: Unexplained empty ref attributes in qhp files
This update fixes a bug introduced by the extensive changes for QTBUG-35377. Three node subtypes - Group, Module, and QML module, were promoted to be first line node types in the update for QTBUG-35377. This broke the file name construction routine for those node subtypes, which used to have the DocNode node type. This caused empty ref attributes to appear for those keyword elements in the qhp file. The file name construction routine has now been corrected to account for this. Task-number: QTBUG-37658 Change-Id: I307979255fdfd48493b3a4cebaf996b2130bc2c7 Reviewed-by: Martin Smith <martin.smith@digia.com>
Diffstat (limited to 'src/tools/qdoc')
-rw-r--r--src/tools/qdoc/generator.cpp10
-rw-r--r--src/tools/qdoc/node.h2
2 files changed, 8 insertions, 4 deletions
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp
index 92ae1bf434..264e489942 100644
--- a/src/tools/qdoc/generator.cpp
+++ b/src/tools/qdoc/generator.cpp
@@ -456,7 +456,7 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir)
if (!fdl.isEmpty())
fdl.append(QLatin1Char('/'));
}
- if (node->type() == Node::Namespace) {
+ if (node->isNamespace()) {
// The root namespace has no name - check for this before creating
// an attribute containing the location of any documentation.
@@ -466,9 +466,8 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir)
else
return QString();
}
- else if (node->type() == Node::Document) {
- if ((node->subType() == Node::QmlClass) ||
- (node->subType() == Node::QmlBasicType)) {
+ else if (node->isDocNode() || node->isCollectionNode()) {
+ if (node->isQmlType() || node->isQmlBasicType()) {
QString fb = fileBase(node);
if (fb.startsWith(Generator::outputPrefix(QLatin1String("QML"))))
return fb + QLatin1Char('.') + currentGenerator()->fileExtension();
@@ -563,6 +562,9 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir)
anchorRef = QLatin1Char('#') + node->name() + "-var";
break;
case Node::Document:
+ case Node::Group:
+ case Node::Module:
+ case Node::QmlModule:
{
parentName = fileBase(node);
parentName.replace(QLatin1Char('/'), QLatin1Char('-')).replace(QLatin1Char('.'), QLatin1Char('-'));
diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h
index 6b735144b1..e0f6e5202d 100644
--- a/src/tools/qdoc/node.h
+++ b/src/tools/qdoc/node.h
@@ -207,6 +207,7 @@ public:
virtual bool isModule() const { return false; }
virtual bool isQmlModule() const { return false; }
virtual bool isQmlType() const { return false; }
+ virtual bool isQmlBasicType() const { return false; }
virtual bool isExample() const { return false; }
virtual bool isExampleFile() const { return false; }
virtual bool isHeaderFile() const { return false; }
@@ -640,6 +641,7 @@ public:
const QString& name);
virtual ~QmlBasicTypeNode() { }
virtual bool isQmlNode() const { return true; }
+ virtual bool isQmlBasicType() const { return true; }
};
class QmlPropertyGroupNode : public InnerNode