diff options
author | Martin Smith <martin.smith@digia.com> | 2012-11-02 09:54:55 +0100 |
---|---|---|
committer | Martin Smith <martin.smith@digia.com> | 2012-11-02 12:41:43 +0100 |
commit | d9d8845d507a6bdbc9c9f24c0d9d86dca513461d (patch) | |
tree | 79a0e56c3907d2c575bb897b240f6ec40325b77e /src/tools | |
parent | 8f1687c572ea661a7b91b0aa675796145513c275 (diff) |
qdoc: Fixed the since list for modularized Qt
This required adding a "since" attribute to the index file.
Task number: QTBUG-27695
Change-Id: I97ca96b837ce404ea85ca8086718be4e7a9e21a8
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/qdoc/node.cpp | 2 | ||||
-rw-r--r-- | src/tools/qdoc/node.h | 4 | ||||
-rw-r--r-- | src/tools/qdoc/qdocdatabase.cpp | 26 | ||||
-rw-r--r-- | src/tools/qdoc/qdocindexfiles.cpp | 18 |
4 files changed, 24 insertions, 26 deletions
diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp index 67805d3dff..3828709b7f 100644 --- a/src/tools/qdoc/node.cpp +++ b/src/tools/qdoc/node.cpp @@ -462,7 +462,7 @@ void Node::setLink(LinkType linkType, const QString &link, const QString &desc) */ void Node::setSince(const QString &since) { - sinc = since.simplified(); + since_ = since.simplified(); } /*! diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h index 451b666a78..05133cab0c 100644 --- a/src/tools/qdoc/node.h +++ b/src/tools/qdoc/node.h @@ -222,7 +222,7 @@ public: Status inheritedStatus() const; ThreadSafeness threadSafeness() const; ThreadSafeness inheritedThreadSafeness() const; - QString since() const { return sinc; } + QString since() const { return since_; } QString templateStuff() const { return templateStuff_; } PageType pageType() const { return pageType_; } QString pageTypeString() const; @@ -280,7 +280,7 @@ private: QMap<LinkType, QPair<QString, QString> > linkMap_; QString moduleName_; QString url_; - QString sinc; + QString since_; QString templateStuff_; mutable QString uuid_; QString outSubDir_; diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp index b6163aa5b0..cb93a92d33 100644 --- a/src/tools/qdoc/qdocdatabase.cpp +++ b/src/tools/qdoc/qdocdatabase.cpp @@ -467,12 +467,11 @@ void QDocDatabase::findAllSince(const InnerNode* node) nsmap.value().insert(func->name(),(*child)); } } - else if ((*child)->url().isEmpty()) { - if ((*child)->type() == Node::Class && !(*child)->doc().isEmpty()) { + else { + if ((*child)->type() == Node::Class) { // Insert classes into the since and class maps. QString className = (*child)->name(); - if ((*child)->parent() && (*child)->parent()->type() == Node::Namespace && - !(*child)->parent()->name().isEmpty()) { + if ((*child)->parent() && !(*child)->parent()->name().isEmpty()) { className = (*child)->parent()->name()+"::"+className; } nsmap.value().insert(className,(*child)); @@ -481,8 +480,7 @@ void QDocDatabase::findAllSince(const InnerNode* node) else if ((*child)->subType() == Node::QmlClass) { // Insert QML elements into the since and element maps. QString className = (*child)->name(); - if ((*child)->parent() && (*child)->parent()->type() == Node::Namespace && - !(*child)->parent()->name().isEmpty()) { + if ((*child)->parent() && !(*child)->parent()->name().isEmpty()) { className = (*child)->parent()->name()+"::"+className; } nsmap.value().insert(className,(*child)); @@ -493,17 +491,15 @@ void QDocDatabase::findAllSince(const InnerNode* node) QString propertyName = (*child)->name(); nsmap.value().insert(propertyName,(*child)); } - } - else { - // Insert external documents into the general since map. - QString name = (*child)->name(); - if ((*child)->parent() && (*child)->parent()->type() == Node::Namespace && - !(*child)->parent()->name().isEmpty()) { - name = (*child)->parent()->name()+"::"+name; + else { + // Insert external documents into the general since map. + QString name = (*child)->name(); + if ((*child)->parent() && !(*child)->parent()->name().isEmpty()) { + name = (*child)->parent()->name()+"::"+name; + } + nsmap.value().insert(name,(*child)); } - nsmap.value().insert(name,(*child)); } - // Recursively find child nodes with since commands. if ((*child)->isInnerNode()) { findAllSince(static_cast<InnerNode *>(*child)); diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp index 33b489d6d0..14dfa334ae 100644 --- a/src/tools/qdoc/qdocindexfiles.cpp +++ b/src/tools/qdoc/qdocindexfiles.cpp @@ -50,13 +50,6 @@ #include "generator.h" #include <qdebug.h> -//include "doc.h" -//include "htmlgenerator.h" -//include "node.h" -//include "text.h" -//include <limits.h> -//include <qdebug.h> - QT_BEGIN_NAMESPACE /*! @@ -447,6 +440,11 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element, section->setUrl(indexUrl + QLatin1Char('/') + href); } + QString since = element.attribute("since"); + if (!since.isEmpty()) { + section->setSince(since); + } + // Create some content for the node. QSet<QString> emptySet; Doc doc(location, location, " ", emptySet); // placeholder @@ -506,7 +504,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, Node* node, bool generateInternalNodes) { - if (!node->url().isEmpty() || node->subType() == Node::DitaMap) + if (node->subType() == Node::DitaMap) return false; QString nodeName; @@ -646,6 +644,10 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, if ((node->type() != Node::Document) && (!node->isQmlNode())) writer.writeAttribute("location", node->location().fileName()); + if (!node->since().isEmpty()) { + writer.writeAttribute("since", node->since()); + } + switch (node->type()) { case Node::Class: { |