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 > 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(*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 -//include "doc.h" -//include "htmlgenerator.h" -//include "node.h" -//include "text.h" -//include -//include - 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 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: {