diff options
author | Casper van Donderen <casper.vandonderen@nokia.com> | 2011-11-22 12:37:49 +0100 |
---|---|---|
committer | Casper van Donderen <casper.vandonderen@nokia.com> | 2011-11-22 12:37:49 +0100 |
commit | c64553058b65411b55455dd41167d822cd5b6e27 (patch) | |
tree | f3ad81fac0888ec54b866042cddedcf49fe4f66e | |
parent | ccd722e1daec26ab981c75abca23bfd360055322 (diff) | |
parent | 6b1c4806cf668ef30ece2f9eba869c622705157a (diff) | |
download | qt4-tools-c64553058b65411b55455dd41167d822cd5b6e27.tar.gz |
Merge remote-tracking branch 'qt-doc-review/master'
-rw-r--r-- | tools/qdoc3/codeparser.cpp | 5 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 13 | ||||
-rw-r--r-- | tools/qdoc3/node.h | 4 |
3 files changed, 22 insertions, 0 deletions
diff --git a/tools/qdoc3/codeparser.cpp b/tools/qdoc3/codeparser.cpp index 9ab5f826c5..9bf9c1403e 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 747d57e6b5..b7a51201fd 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -4503,6 +4503,19 @@ 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 = "$QTDIR/"; + if (demos) + file += "demos/"; + else + file += "examples/"; + file += en->dependencies()[idx]; + writer.writeCharacters(file); + writer.writeEndElement(); // dependency + } + } writer.writeEndElement(); // example ++i; } diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index a08151a2a9..60636d1848 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 |