summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorCasper van Donderen <casper.vandonderen@nokia.com>2012-05-16 14:44:38 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-16 22:04:47 +0200
commit438787b0ca18b08993bfa640ddf0ad5e6d2340e8 (patch)
tree363d0fc54490e68aa96756219b4ed926c2ad7041 /src/tools
parenta70b8d407e1ca46e5dc208580534feee7ddfe51a (diff)
QDoc: Generate correct relative paths and links when using -installdir.
This change will generate working links between all modules in qtbase. Some testing needs to be done on the other modules. Change-Id: Ic65a9c753f891ac51427ca7c1cdcab13611d2f5b Reviewed-by: Martin Smith <martin.smith@nokia.com>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/qdoc/main.cpp5
-rw-r--r--src/tools/qdoc/tree.cpp10
2 files changed, 9 insertions, 6 deletions
diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp
index 2783cd0027..bb0aa7e811 100644
--- a/src/tools/qdoc/main.cpp
+++ b/src/tools/qdoc/main.cpp
@@ -254,6 +254,11 @@ static void processQdocconfFile(const QString &fileName)
if (dependModules.size() > 0) {
if (indexDirs.size() > 0) {
+ for (int j = 0; j < indexDirs.size(); j++) {
+ if (indexDirs[j].startsWith("..")) {
+ indexDirs[j].prepend(QDir(dir).relativeFilePath(prevCurrentDir));
+ }
+ }
for (int i = 0; i < dependModules.size(); i++) {
QMultiMap<uint, QFileInfo> foundIndices;
for (int j = 0; j < indexDirs.size(); j++) {
diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp
index d0a2123ff5..b600102c41 100644
--- a/src/tools/qdoc/tree.cpp
+++ b/src/tools/qdoc/tree.cpp
@@ -946,7 +946,9 @@ void Tree::readIndexFile(const QString& path)
indexUrl = indexElement.attribute("url", "");
}
else {
- QDir installDir(Config::installDir);
+ // Use a fake directory, since we will copy the output to a sub directory of
+ // installDir when using "make install". This is just for a proper relative path.
+ QDir installDir(Config::installDir + "/outputdir");
indexUrl = installDir.relativeFilePath(path).section('/', 0, -2);
}
@@ -1001,7 +1003,6 @@ void Tree::readIndexSection(const QDomElement& element,
location = Location(indexUrl + QLatin1Char('/') + name.toLower() + ".html");
else if (!indexUrl.isNull())
location = Location(name.toLower() + ".html");
-
}
else if ((element.nodeName() == "qmlclass") ||
((element.nodeName() == "page") && (element.attribute("subtype") == "qmlclass"))) {
@@ -1275,10 +1276,7 @@ void Tree::readIndexSection(const QDomElement& element,
section->setModuleName(element.attribute("module"));
if (!indexUrl.isEmpty()) {
- if (indexUrl.startsWith(QLatin1Char('.')))
- section->setUrl(href);
- else
- section->setUrl(indexUrl + QLatin1Char('/') + href);
+ section->setUrl(indexUrl + QLatin1Char('/') + href);
}
// Create some content for the node.