summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/tree.cpp
diff options
context:
space:
mode:
authorCasper van Donderen <casper.vandonderen@nokia.com>2012-04-23 16:47:43 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-25 10:29:56 +0200
commit82fcbe9d7d7505bb2e3fc53789e14405e73d5302 (patch)
tree7048f5b8942f936bba980914383272c0d2682384 /src/tools/qdoc/tree.cpp
parent3de77c3daa3e7ddda7d297a2cc2061296297d7f6 (diff)
QDoc: Implement -installdir CLI option for module cross-linking.
QDoc needs to know the final location of the installed documentation to generate correct relative links between the modules. Normally you can use QLibraryInfo::DocumentationPath for this, but since QDoc gets compiled during Qt bootstrapping QLibraryInfo is not available yet. The -installdir option still allows us to specify QLibraryInfo::DocumentationPath on the command line. Change-Id: Ic4729f4daad112f0d175931467cf09cfcf5145a3 Reviewed-by: Martin Smith <martin.smith@nokia.com>
Diffstat (limited to 'src/tools/qdoc/tree.cpp')
-rw-r--r--src/tools/qdoc/tree.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp
index 98c269dccc2..a81f80f1060 100644
--- a/src/tools/qdoc/tree.cpp
+++ b/src/tools/qdoc/tree.cpp
@@ -967,7 +967,18 @@ void Tree::readIndexFile(const QString& path)
file.close();
QDomElement indexElement = document.documentElement();
- QString indexUrl = indexElement.attribute("url", "");
+
+ // Generate a relative URL between the install dir and the index file
+ // when the -installdir command line option is set.
+ QString indexUrl;
+ if (Config::installDir.isEmpty()) {
+ indexUrl = indexElement.attribute("url", "");
+ }
+ else {
+ QDir installDir(Config::installDir);
+ indexUrl = installDir.relativeFilePath(path).section('/', 0, -2);
+ }
+
priv->basesList.clear();
priv->relatedList.clear();