diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-11-22 21:34:44 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-11-22 21:34:44 (GMT) |
commit | 526eda58dae96dca2c5aebcb48b007f09bd7ecac (patch) | |
tree | 2262444830c9b20cf88c568f98b916aef1acb1ff /tools | |
parent | 5f2090f0f2280c32d06fbc5188ccb799d7b1a489 (diff) | |
parent | 0f4a61a33942744b1609c2b375d28765a215e39f (diff) | |
download | Qt-526eda58dae96dca2c5aebcb48b007f09bd7ecac.zip Qt-526eda58dae96dca2c5aebcb48b007f09bd7ecac.tar.gz Qt-526eda58dae96dca2c5aebcb48b007f09bd7ecac.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-doc-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-doc-staging: (72 commits)
Add note to declarative calculator example
Help: Add \depends to all declarative examples & demos
Declarative Examples: Fall back to local qmlapplicationviewer.
Fix qdoc output for <dependency> tag.
Change installation location of examples.
Add Symbian platform notes.
Fix "make install" for declarative examples
Add C++11 support and QThreadLocalStorage changes to docs.
Update the license in the qmlapplicationviewer.
Examples: Add Copright headers, Remove stray file.
Compile fix.
Fix use of qmlapplicationviewer.
Doc: Create relative pathes in Manifest files.
Doc: Copy manifest files to the places where Creator expects them.
qdoc3: qdoc supports \depends in 4.8
qdoc3: qdoc supports \depends in 4.8
Update qrc files.
Update qmlapplicationviewer template,
cppextensions/qgraphicslayout example corrections
demos/declarative/snake example corrections
...
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qdoc3/codeparser.cpp | 5 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 30 | ||||
-rw-r--r-- | tools/qdoc3/node.h | 4 |
3 files changed, 39 insertions, 0 deletions
diff --git a/tools/qdoc3/codeparser.cpp b/tools/qdoc3/codeparser.cpp index 9ab5f82..9bf9c14 100644 --- a/tools/qdoc3/codeparser.cpp +++ b/tools/qdoc3/codeparser.cpp @@ -51,6 +51,7 @@ QT_BEGIN_NAMESPACE #define COMMAND_COMPAT Doc::alias(QLatin1String("compat")) +#define COMMAND_DEPENDS Doc::alias(QLatin1String("depends")) #define COMMAND_DEPRECATED Doc::alias(QLatin1String("deprecated")) // ### don't document #define COMMAND_INGROUP Doc::alias(QLatin1String("ingroup")) #define COMMAND_INMODULE Doc::alias(QLatin1String("inmodule")) // ### don't document @@ -200,6 +201,7 @@ CodeParser *CodeParser::parserForSourceFile(const QString &filePath) QSet<QString> CodeParser::commonMetaCommands() { return QSet<QString>() << COMMAND_COMPAT + << COMMAND_DEPENDS << COMMAND_DEPRECATED << COMMAND_INGROUP << COMMAND_INMODULE @@ -231,6 +233,9 @@ void CodeParser::processCommonMetaCommand(const Location &location, if (command == COMMAND_COMPAT) { node->setStatus(Node::Compat); } + else if (command == COMMAND_DEPENDS) { + node->addDependency(arg); + } else if (command == COMMAND_DEPRECATED) { node->setStatus(Node::Deprecated); } diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 923d523..bc84288 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,31 @@ 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"))); + + QString relativePath; + 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; } @@ -4483,6 +4503,16 @@ void HtmlGenerator::generateManifestFile(QString manifest, QString element) } } } + if (!en->dependencies().isEmpty()) { + for (int idx=0; idx<en->dependencies().size(); ++idx) { + writer.writeStartElement("dependency"); + QString file(en->dependencies()[idx]); + if (!relativePath.isEmpty()) + file.prepend(relativePath); + writer.writeCharacters(file); + writer.writeEndElement(); // dependency + } + } writer.writeEndElement(); // example ++i; } diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index a08151a..60636d1 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -167,6 +167,7 @@ class Node void setTemplateStuff(const QString &templateStuff) { tpl = templateStuff; } void setPageType(PageType t) { pageTyp = t; } void setPageType(const QString& t); + virtual void addDependency(const QString& ) { } virtual bool isInnerNode() const = 0; virtual bool isReimp() const { return false; } @@ -409,12 +410,15 @@ class ExampleNode : public FakeNode virtual ~ExampleNode() { } virtual QString imageFileName() const { return imageFileName_; } virtual void setImageFileName(const QString& ifn) { imageFileName_ = ifn; } + virtual void addDependency(const QString& arg) { dependencies_.append(arg); } + const QStringList& dependencies() const { return dependencies_; } public: static ExampleNodeMap exampleNodeMap; private: QString imageFileName_; + QStringList dependencies_; }; class QmlClassNode : public FakeNode |