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>
This commit is contained in:
Martin Smith 2014-03-20 13:51:35 +01:00 committed by The Qt Project
parent 2ea15849a0
commit d13d03f012
2 changed files with 8 additions and 4 deletions

View File

@ -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('-'));

View File

@ -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