diff options
Diffstat (limited to 'src/qdoc/htmlgenerator.cpp')
-rw-r--r-- | src/qdoc/htmlgenerator.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp index 9f29d099c..8d6d5000f 100644 --- a/src/qdoc/htmlgenerator.cpp +++ b/src/qdoc/htmlgenerator.cpp @@ -219,8 +219,6 @@ void HtmlGenerator::initializeGenerator(const Config &config) + QLatin1Char('/'); readManifestMetaContent(config); examplesPath = config.getString(CONFIG_EXAMPLESINSTALLPATH); - if (!examplesPath.isEmpty()) - examplesPath += QLatin1Char('/'); // Retrieve the config for the navigation bar homepage = config.getString(CONFIG_NAVIGATION + Config::dot + CONFIG_HOMEPAGE); @@ -3892,6 +3890,14 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString } else if (en->name().startsWith("demos")) { continue; } + + // Retrieve the install path specified with \meta command, + // or fall back to the one defined in .qdocconf + QString installPath = en->doc().metaTagMap().value(QLatin1String("installpath")); + if (installPath.isEmpty()) + installPath = examplesPath; + if (!installPath.isEmpty() && !installPath.endsWith(QLatin1Char('/'))) + installPath += QLatin1Char('/'); // attributes that are always written for the element usedAttributes.clear(); usedAttributes << "name" @@ -3911,7 +3917,7 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString } if (!proFiles.isEmpty()) { if (proFiles.size() == 1) { - writer.writeAttribute("projectPath", examplesPath + proFiles[0]); + writer.writeAttribute("projectPath", installPath + proFiles[0]); } else { QString exampleName = en->name().split('/').last(); bool proWithExampleNameFound = false; @@ -3920,13 +3926,13 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString || proFiles[j].endsWith(QStringLiteral("%1/%1.qmlproject").arg(exampleName)) || proFiles[j].endsWith( QStringLiteral("%1/%1.pyproject").arg(exampleName))) { - writer.writeAttribute("projectPath", examplesPath + proFiles[j]); + writer.writeAttribute("projectPath", installPath + proFiles[j]); proWithExampleNameFound = true; break; } } if (!proWithExampleNameFound) - writer.writeAttribute("projectPath", examplesPath + proFiles[0]); + writer.writeAttribute("projectPath", installPath + proFiles[0]); } } if (!en->imageFileName().isEmpty()) { @@ -4064,7 +4070,7 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString if (--it == filesToOpen.constBegin()) { writer.writeAttribute(QStringLiteral("mainFile"), QStringLiteral("true")); } - writer.writeCharacters(examplesPath + it.value()); + writer.writeCharacters(installPath + it.value()); writer.writeEndElement(); } |