qdoc: Fix output file name generation for examples

When generating output file names for examples, qdoc prepends
a module-specific prefix. Unless already defined, it defaults
to the project name defined in .qdocconf file. This leads to
wrong prefix being used in some cases - specifically, on pages
in qtdoc module listing examples in other modules.

This change takes the modulename prefix from the node, and
only uses the project name as a fallback.

Task-number: QTBUG-34581
Change-Id: Ia0a940cbc05ed819ff36c328cf9c1e30e2c65b5e
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
This commit is contained in:
Topi Reinio 2013-11-05 11:59:02 +01:00 committed by The Qt Project
parent a94f61063a
commit 170da92d02

View File

@ -351,7 +351,11 @@ QString Generator::fileBase(const Node *node) const
base.append("-module");
}
if (node->isExample() || node->isExampleFile()) {
base.prepend(project.toLower() + QLatin1Char('-'));
QString modPrefix(node->moduleName());
if (modPrefix.isEmpty()) {
modPrefix = project;
}
base.prepend(modPrefix.toLower() + QLatin1Char('-'));
}
if (node->isExample()) {
base.append(QLatin1String("-example"));