Allow qdocconf to specify where the examples are located in install.
We have qdoc configurations for the different qtbase libraries and modules now, which specify e.g. "../../../examples/opengl" for the exampledirs. That means that qdoc finds examples like "2dpainting/2dpainting.pro" which is then installed into "[QT_INSTALL_EXAMPLES]/opengl/2dpainting/2dpainting.pro". (At the moment even into "[QT_INSTALL_EXAMPLES]/qtbase/opengl/...", which will be changed to match the structure in source.) In order for Qt Creator to find the examples, qdoc must write the path behind [QT_INSTALL_EXAMPLES] into the example manifest file. This patch introduces "examplesinstallpath" that allows qdoc configs to specify the missing part, e.g. the opengl qdocconf can add examplesinstallpath = opengl to tell qdoc that the examples will be installed into "[QT_INSTALL_EXAMPLES]/opengl/" Task-number: QTBUG-27801 Change-Id: Idf518e16d3ca0f9522b084e92f34725b93e9d11f Reviewed-by: Martin Smith <martin.smith@digia.com>
This commit is contained in:
parent
a2ab156872
commit
274407f347
@ -168,6 +168,7 @@ private:
|
||||
#define CONFIG_ENDHEADER "endheader"
|
||||
#define CONFIG_EXAMPLEDIRS "exampledirs"
|
||||
#define CONFIG_EXAMPLES "examples"
|
||||
#define CONFIG_EXAMPLESINSTALLPATH "examplesinstallpath"
|
||||
#define CONFIG_EXCLUDEDIRS "excludedirs"
|
||||
#define CONFIG_EXCLUDEFILES "excludefiles"
|
||||
#define CONFIG_EXTRAIMAGES "extraimages"
|
||||
|
@ -223,7 +223,9 @@ void HtmlGenerator::initializeGenerator(const Config &config)
|
||||
QString prefix = CONFIG_QHP + Config::dot + project + Config::dot;
|
||||
manifestDir = "qthelp://" + config.getString(prefix + "namespace");
|
||||
manifestDir += QLatin1Char('/') + config.getString(prefix + "virtualFolder") + QLatin1Char('/');
|
||||
|
||||
examplesPath = config.getString(CONFIG_EXAMPLESINSTALLPATH);
|
||||
if (!examplesPath.isEmpty())
|
||||
examplesPath += QLatin1Char('/');
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -4094,7 +4096,7 @@ void HtmlGenerator::generateManifestFile(QString manifest, QString element)
|
||||
}
|
||||
if (!proFiles.isEmpty()) {
|
||||
if (proFiles.size() == 1) {
|
||||
writer.writeAttribute("projectPath", proFiles[0]);
|
||||
writer.writeAttribute("projectPath", examplesPath + proFiles[0]);
|
||||
}
|
||||
else {
|
||||
QString exampleName = en->name().split('/').last();
|
||||
@ -4103,13 +4105,13 @@ void HtmlGenerator::generateManifestFile(QString manifest, QString element)
|
||||
{
|
||||
if (proFiles[j].endsWith(QStringLiteral("%1/%1.pro").arg(exampleName))
|
||||
|| proFiles[j].endsWith(QStringLiteral("%1/%1.qmlproject").arg(exampleName))) {
|
||||
writer.writeAttribute("projectPath", proFiles[j]);
|
||||
writer.writeAttribute("projectPath", examplesPath + proFiles[j]);
|
||||
proWithExampleNameFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!proWithExampleNameFound)
|
||||
writer.writeAttribute("projectPath", proFiles[0]);
|
||||
writer.writeAttribute("projectPath", examplesPath + proFiles[0]);
|
||||
}
|
||||
}
|
||||
if (!en->imageFileName().isEmpty())
|
||||
|
@ -236,6 +236,7 @@ private:
|
||||
QString projectUrl;
|
||||
QString navigationLinks;
|
||||
QString manifestDir;
|
||||
QString examplesPath;
|
||||
QStringList stylesheets;
|
||||
QStringList customHeadElements;
|
||||
bool obsoleteLinks;
|
||||
|
Loading…
Reference in New Issue
Block a user