diff options
author | Jerome Pasion <jerome.pasion@nokia.com> | 2011-03-07 14:36:15 (GMT) |
---|---|---|
committer | Jerome Pasion <jerome.pasion@nokia.com> | 2011-03-07 14:36:15 (GMT) |
commit | 133db91952ede661750489d5d0d1eea32cc60994 (patch) | |
tree | 6f8b99a6f984856846e98c1014cee209c4bc85b2 | |
parent | 8dd7ff1633c8f1881153ba9824cd2dd1abcc11b9 (diff) | |
parent | ea8a4080bfc341785c8852a66c90050f72a58e12 (diff) | |
download | Qt-133db91952ede661750489d5d0d1eea32cc60994.zip Qt-133db91952ede661750489d5d0d1eea32cc60994.tar.gz Qt-133db91952ede661750489d5d0d1eea32cc60994.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-doc-team into 4.7
-rw-r--r-- | src/corelib/kernel/qtranslator.cpp | 13 | ||||
-rw-r--r-- | src/corelib/tools/qmap.cpp | 2 | ||||
-rw-r--r-- | tools/qdoc3/ditaxmlgenerator.cpp | 116 | ||||
-rw-r--r-- | tools/qdoc3/ditaxmlgenerator.h | 1 | ||||
-rw-r--r-- | tools/qdoc3/node.cpp | 8 | ||||
-rw-r--r-- | tools/qdoc3/node.h | 3 |
6 files changed, 113 insertions, 30 deletions
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index d72c1ab..73a32c4 100644 --- a/src/corelib/kernel/qtranslator.cpp +++ b/src/corelib/kernel/qtranslator.cpp @@ -354,10 +354,15 @@ QTranslator::~QTranslator() } /*! - Loads \a filename + \a suffix (".qm" if the \a suffix is - not specified), which may be an absolute file name or relative - to \a directory. Returns true if the translation is successfully - loaded; otherwise returns false. + + Loads \a filename + \a suffix (".qm" if the \a suffix is not + specified), which may be an absolute file name or relative to \a + directory. Returns true if the translation is successfully loaded; + otherwise returns false. + + If \a directory is not specified, the directory of the + application's executable is used (i.e., as + \l{QCoreApplication::}{applicationDirPath()}). The previous contents of this translator object are discarded. diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp index fe53374..2c028af 100644 --- a/src/corelib/tools/qmap.cpp +++ b/src/corelib/tools/qmap.cpp @@ -1073,7 +1073,7 @@ void QMapData::dump() \overload - The prefix -- operator (\c{--i}) makes the preceding item + The postfix -- operator (\c{i--}) makes the preceding item current and returns an iterator pointing to the previously current item. */ diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index ced14cc..66f4a91 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1637,11 +1637,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark */ generateHeader(inner, fullTitle); generateBrief(inner, marker); // <shortdesc> - - writeStartTag(DT_prolog); - writeStartTag(DT_metadata); - writeEndTag(); // <metadata> - writeEndTag(); // <prolog> + writeProlog(inner,marker); writeStartTag(DT_cxxClassDetail); writeStartTag(DT_cxxClassDefinition); @@ -1764,11 +1760,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark generateHeader(inner, fullTitle); generateBrief(inner, marker); // <shortdesc> - - writeStartTag(DT_prolog); - writeStartTag(DT_metadata); - writeEndTag(); // <metadata> - writeEndTag(); // <prolog> + writeProlog(inner,marker); writeStartTag(DT_cxxClassDetail); writeStartTag(DT_cxxClassDefinition); @@ -1909,11 +1901,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark */ generateHeader(inner, fullTitle); generateBrief(inner, marker); // <shortdesc> - - writeStartTag(DT_prolog); - writeStartTag(DT_metadata); - writeEndTag(); // <metadata> - writeEndTag(); // <prolog> + writeProlog(inner,marker); writeStartTag(DT_cxxClassDetail); writeStartTag(DT_apiDesc); @@ -2034,12 +2022,8 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark generateHeader(inner, fullTitle); generateBrief(inner, marker); // <shortdesc> + writeProlog(inner,marker); - writeStartTag(DT_prolog); - writeStartTag(DT_metadata); - writeEndTag(); // <metadata> - writeEndTag(); // <prolog> - writeStartTag(DT_cxxClassDetail); writeStartTag(DT_apiDesc); xmlWriter().writeAttribute("spectitle",title); @@ -2148,11 +2132,7 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode* fake, CodeMarker* marker generateHeader(fake, fullTitle); generateBrief(fake, marker); // <shortdesc> - - writeStartTag(DT_prolog); - writeStartTag(DT_metadata); - writeEndTag(); // <metadata> - writeEndTag(); // <prolog> + writeProlog(fake, marker); writeStartTag(DT_body); if (fake->subType() == Node::Module) { @@ -5548,4 +5528,90 @@ void DitaXmlGenerator::writeDitaMap() endSubPage(); } +/*! + Writes the <prolog> element for the \a inner node + using the \a marker. The <prolog> element contains + the <metadata> element, plus some others. This + function writes one or more of these elements: + + \list + \o <audience> + \o <author> + \o <brand> + \o <category> + \o <compomnent> + \o <copyrholder> + \o <copyright> + \o <created> + \o <copyryear> + \o <critdates> + \o <keyword> + \o <keywords> + \o <metadata> + \o <othermeta> + \o <permissions> + \o <platform> + \o <prodinfo> + \o <prodname> + \o <prolog> + \o <publisher> + \o <resourceid> + \o <revised> + \o <source> + \o <tm> + \o <unknown> + \o <vrm> + \o <vrmlist> + \endlist + + */ +void +DitaXmlGenerator::writeProlog(const InnerNode* inner, CodeMarker* marker) +{ + if (!inner) + return; + writeStartTag(DT_prolog); + + writeStartTag(DT_author); + QString author = inner->author(); + if (author.isEmpty()) + author = "Qt Development Frameworks"; + xmlWriter().writeCharacters(author); + writeEndTag(); // <author> + + writeStartTag(DT_metadata); + writeStartTag(DT_category); + QString category = "Page"; + if (inner->type() == Node::Class) + category = "C++ Class"; + else if (inner->type() == Node::Namespace) + category = "C++ Namespace"; + else if (inner->type() == Node::Fake) { + if (inner->subType() == Node::QmlBasicType) + category = "QML Class"; + else if (inner->subType() == Node::QmlClass) + category = "QML Basic Type"; + else if (inner->subType() == Node::HeaderFile) + category = "Header File"; + else if (inner->subType() == Node::Module) + category = "Module"; + else if (inner->subType() == Node::File) + category = "Example Source File"; + else if (inner->subType() == Node::Example) + category = "Example"; + else if (inner->subType() == Node::Image) + category = "Image"; + else if (inner->subType() == Node::Group) + category = "Group"; + else if (inner->subType() == Node::Page) + category = "Page"; + else if (inner->subType() == Node::ExternalPage) + category = "External Page"; // Is this necessary? + } + xmlWriter().writeCharacters(category); + writeEndTag(); // <category> + writeEndTag(); // <metadata> + writeEndTag(); // <prolog> +} + QT_END_NAMESPACE diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 2384a90..32a9b94 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -315,6 +315,7 @@ class DitaXmlGenerator : public PageGenerator void writePropertyParameter(const QString& tag, const NodeList& nlist); void writeRelatedLinks(const FakeNode* fake, CodeMarker* marker); void writeLink(const Node* node, const QString& tex, const QString& role); + void writeProlog(const InnerNode* inner, CodeMarker* marker); private: enum SubTitleSize { SmallSubTitle, LargeSubTitle }; diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index ee050f5..161c87a 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -771,6 +771,14 @@ void InnerNode::removeChild(Node *child) } } +/*! \fn QString InnerNode::author() const + Returns the author. + */ + +/*! \fn void InnerNode::setAuthor(const QString& author) + Sets the \a author. + */ + /*! Find the module (QtCore, QtGui, etc.) to which the class belongs. We do this by obtaining the full path to the header file's location diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index d1123dc..3869e68 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -262,6 +262,8 @@ class InnerNode : public Node NodeList overloads(const QString &funcName) const; const QStringList& includes() const { return inc; } + QString author() const { return author_; } + void setAuthor(const QString& author) { author_ = author; } QStringList primaryKeys(); QStringList secondaryKeys(); const QStringList& pageKeywords() const { return pageKeywds; } @@ -280,6 +282,7 @@ class InnerNode : public Node void removeChild(Node* child); void removeRelated(Node* pseudoChild); + QString author_; QStringList pageKeywds; QStringList inc; NodeList children; |