qdoc: Fix a regression with QML node attributes written to index files

QDoc needs to write the following attributes to index files:

For qmlclass:  qml-module-name, qml-base-type
For qmlmodule: qml-module-name, qml-module-version

Because of a regression introduced in Qt 5.5, no QML module name
or base type information were written for QML types, resulting in
linking issues.

Change-Id: I69e616dadfc9ede389bc05e16acb831f1e15bac5
Task-number: QTBUG-48479
Reviewed-by: Martin Smith <martin.smith@digia.com>
This commit is contained in:
Topi Reinio 2015-09-28 12:29:19 +02:00 committed by Topi Reiniö
parent 17f649ab29
commit e03bcdea62

View File

@ -946,27 +946,27 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
}
writer.writeAttribute("name", objName);
if (node->isQmlModule()) {
logicalModuleName = node->logicalModuleName();
logicalModuleVersion = node->logicalModuleVersion();
if (!logicalModuleName.isEmpty()) {
writer.writeAttribute("qml-module-name", logicalModuleName);
if (node->isQmlModule())
writer.writeAttribute("qml-module-version", logicalModuleVersion);
if (!qmlFullBaseName.isEmpty())
writer.writeAttribute("qml-base-type", qmlFullBaseName);
// Write module and base type info for QML/JS types
if (node->type() == Node::QmlType || node->type() == Node::QmlModule) {
QString baseNameAttr("qml-base-type");
QString moduleNameAttr("qml-module-name");
QString moduleVerAttr("qml-module-version");
if (node->isJsNode()) {
baseNameAttr = "js-base-type";
moduleNameAttr = "js-module-name";
moduleVerAttr = "js-module-version";
}
}
else if (node->isJsModule()) {
logicalModuleName = node->logicalModuleName();
logicalModuleVersion = node->logicalModuleVersion();
if (!logicalModuleName.isEmpty()) {
writer.writeAttribute("js-module-name", logicalModuleName);
if (node->isQmlModule())
writer.writeAttribute("js-module-version", logicalModuleVersion);
if (!qmlFullBaseName.isEmpty())
writer.writeAttribute("js-base-type", qmlFullBaseName);
if (node->type() == Node::QmlModule) {
logicalModuleName = node->logicalModuleName();
logicalModuleVersion = node->logicalModuleVersion();
}
if (!logicalModuleName.isEmpty())
writer.writeAttribute(moduleNameAttr, logicalModuleName);
if (!logicalModuleVersion.isEmpty())
writer.writeAttribute(moduleVerAttr, logicalModuleVersion);
if (!qmlFullBaseName.isEmpty())
writer.writeAttribute(baseNameAttr, qmlFullBaseName);
}
QString href;