diff options
author | Topi Reinio <topi.reinio@digia.com> | 2013-11-05 11:59:02 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-07 10:00:19 +0100 |
commit | 170da92d02f2e81bafc9efdf76b2c4facf6486d0 (patch) | |
tree | 6b502cbe9e04117868a626c66506ba80f13d524a /src | |
parent | a94f61063a031444849fb0873f9b267a4f828597 (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/qdoc/generator.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp index 357e013360..97a980a3fa 100644 --- a/src/tools/qdoc/generator.cpp +++ b/src/tools/qdoc/generator.cpp @@ -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")); |