summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@digia.com>2012-11-08 15:22:10 +0100
committerMartin Smith <martin.smith@digia.com>2012-11-08 15:41:20 +0100
commit2cf7aceb4ecb73b47494f1058224eb44b39f0d55 (patch)
tree7261b3264dd7f023e3499dc05b415cd259903a9c
parentec1cd70a718255bb84535a0aea3fc697c0597b3d (diff)
qdoc: better copying of .css files
This fix searches for the css files specified in the stylesheets variable. It searches for them in the directory specified as the templatedir. It copies them into the style subdirectory of the outputdir. Task-number: QTBUG-27878 Change-Id: Ic9ff43ab6f939cb50f1b41a9cc58f3f8686ebaf5 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
-rw-r--r--src/tools/qdoc/generator.cpp86
1 files changed, 40 insertions, 46 deletions
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp
index 0384765157..67e18b45dd 100644
--- a/src/tools/qdoc/generator.cpp
+++ b/src/tools/qdoc/generator.cpp
@@ -1546,55 +1546,49 @@ void Generator::initialize(const Config &config)
}
// Documentation template handling
- QString templateDir = config.getString((*g)->format() + Config::dot + CONFIG_TEMPLATEDIR);
-
QStringList searchDirs;
- if (!templateDir.isEmpty()) {
- searchDirs.append(templateDir);
- }
- if (!Config::installDir.isEmpty()) {
- searchDirs.append(Config::installDir);
+ QString templateDir = config.getString((*g)->format() + Config::dot + CONFIG_TEMPLATEDIR);
+ if (templateDir.isEmpty())
+ templateDir = ".";
+ searchDirs.append(templateDir);
+
+ QStringList noExts;
+ QStringList scripts = config.getCleanPathList((*g)->format()+Config::dot+CONFIG_SCRIPTS);
+ e = scripts.constBegin();
+ while (e != scripts.constEnd()) {
+ QString userFriendlyFilePath;
+ QString filePath = Config::findFile(config.lastLocation(),
+ scriptFiles,
+ searchDirs,
+ *e,
+ noExts,
+ userFriendlyFilePath);
+ if (!filePath.isEmpty())
+ Config::copyFile(config.lastLocation(),
+ filePath,
+ userFriendlyFilePath,
+ (*g)->outputDir() +
+ "/scripts");
+ ++e;
}
- if (!searchDirs.isEmpty()) {
- QStringList noExts;
- QStringList scripts = config.getCleanPathList((*g)->format()+Config::dot+CONFIG_SCRIPTS);
- e = scripts.constBegin();
- while (e != scripts.constEnd()) {
- QString userFriendlyFilePath;
- QString filePath = Config::findFile(config.lastLocation(),
- scriptFiles,
- searchDirs,
- *e,
- noExts,
- userFriendlyFilePath);
- if (!filePath.isEmpty())
- Config::copyFile(config.lastLocation(),
- filePath,
- userFriendlyFilePath,
- (*g)->outputDir() +
- "/scripts");
- ++e;
- }
-
- QStringList styles = config.getCleanPathList((*g)->format()+Config::dot+CONFIG_STYLESHEETS);
- e = styles.constBegin();
- while (e != styles.constEnd()) {
- QString userFriendlyFilePath;
- QString filePath = Config::findFile(config.lastLocation(),
- styleFiles,
- searchDirs,
- *e,
- noExts,
- userFriendlyFilePath);
- if (!filePath.isEmpty())
- Config::copyFile(config.lastLocation(),
- filePath,
- userFriendlyFilePath,
- (*g)->outputDir() +
- "/style");
- ++e;
- }
+ QStringList styles = config.getCleanPathList((*g)->format()+Config::dot+CONFIG_STYLESHEETS);
+ e = styles.constBegin();
+ while (e != styles.constEnd()) {
+ QString userFriendlyFilePath;
+ QString filePath = Config::findFile(config.lastLocation(),
+ styleFiles,
+ searchDirs,
+ *e,
+ noExts,
+ userFriendlyFilePath);
+ if (!filePath.isEmpty())
+ Config::copyFile(config.lastLocation(),
+ filePath,
+ userFriendlyFilePath,
+ (*g)->outputDir() +
+ "/style");
+ ++e;
}
}
++g;