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>
This commit is contained in:
parent
8f1687c572
commit
d9d8845d50
@ -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();
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -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_;
|
||||
|
@ -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));
|
||||
|
@ -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:
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user