diff options
author | Daniel Molkentin <daniel.molkentin@nokia.com> | 2011-11-18 10:10:50 (GMT) |
---|---|---|
committer | Daniel Molkentin <daniel.molkentin@nokia.com> | 2011-11-21 12:50:48 (GMT) |
commit | 7eb8de4dde6df60b26e5297407573f01634415c3 (patch) | |
tree | 1908ad7b674862defedb1af436d6a95fcec69c65 /tools/qdoc3 | |
parent | 002a9f1868be72c5d18a0568c77c7dc1d06de010 (diff) | |
download | Qt-7eb8de4dde6df60b26e5297407573f01634415c3.zip Qt-7eb8de4dde6df60b26e5297407573f01634415c3.tar.gz Qt-7eb8de4dde6df60b26e5297407573f01634415c3.tar.bz2 |
Doc: Create relative pathes in Manifest files.
Conditions: shadow build & non-prefix build
Reviewed-by: Casper van Donderen
Diffstat (limited to 'tools/qdoc3')
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 923d523..8526bff 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -56,6 +56,7 @@ #include <qlist.h> #include <qiterator.h> #include <qtextcodec.h> +#include <qlibraryinfo.h> #include <QUuid> QT_BEGIN_NAMESPACE @@ -4404,12 +4405,32 @@ void HtmlGenerator::generateManifestFile(QString manifest, QString element) //QString docUrl = projectUrl + "/" + en->fileBase() + ".html"; QString docUrl = manifestDir + en->fileBase() + ".html"; writer.writeAttribute("docUrl", docUrl); + + + QDir installDir(QLibraryInfo::location(QLibraryInfo::DataPath)); + QDir buildDir(QString::fromLocal8Bit(qgetenv("QT_BUILD_TREE"))); + QDir sourceDir(QString::fromLocal8Bit(qgetenv("QT_SOURCE_TREE"))); + + + if (buildDir.exists() && sourceDir.exists() + // shadow build, but no prefix build + && installDir == buildDir && buildDir != sourceDir) { + relativePath = QString("../%1/%2/").arg(buildDir.relativeFilePath(sourceDir.path())); + if (demos) + relativePath = relativePath.arg("demos"); + else + relativePath = relativePath.arg("examples"); + } + + foreach (const Node* child, en->childNodes()) { if (child->subType() == Node::File) { QString file = child->name(); if (file.endsWith(".pro") || file.endsWith(".qmlproject")) { if (file.startsWith("demos/")) file = file.mid(6); + if (!relativePath.isEmpty()) + file.prepend(relativePath); writer.writeAttribute("projectPath", file); break; } |