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)
|
void Node::setSince(const QString &since)
|
||||||
{
|
{
|
||||||
sinc = since.simplified();
|
since_ = since.simplified();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -222,7 +222,7 @@ public:
|
|||||||
Status inheritedStatus() const;
|
Status inheritedStatus() const;
|
||||||
ThreadSafeness threadSafeness() const;
|
ThreadSafeness threadSafeness() const;
|
||||||
ThreadSafeness inheritedThreadSafeness() const;
|
ThreadSafeness inheritedThreadSafeness() const;
|
||||||
QString since() const { return sinc; }
|
QString since() const { return since_; }
|
||||||
QString templateStuff() const { return templateStuff_; }
|
QString templateStuff() const { return templateStuff_; }
|
||||||
PageType pageType() const { return pageType_; }
|
PageType pageType() const { return pageType_; }
|
||||||
QString pageTypeString() const;
|
QString pageTypeString() const;
|
||||||
@ -280,7 +280,7 @@ private:
|
|||||||
QMap<LinkType, QPair<QString, QString> > linkMap_;
|
QMap<LinkType, QPair<QString, QString> > linkMap_;
|
||||||
QString moduleName_;
|
QString moduleName_;
|
||||||
QString url_;
|
QString url_;
|
||||||
QString sinc;
|
QString since_;
|
||||||
QString templateStuff_;
|
QString templateStuff_;
|
||||||
mutable QString uuid_;
|
mutable QString uuid_;
|
||||||
QString outSubDir_;
|
QString outSubDir_;
|
||||||
|
@ -467,12 +467,11 @@ void QDocDatabase::findAllSince(const InnerNode* node)
|
|||||||
nsmap.value().insert(func->name(),(*child));
|
nsmap.value().insert(func->name(),(*child));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((*child)->url().isEmpty()) {
|
else {
|
||||||
if ((*child)->type() == Node::Class && !(*child)->doc().isEmpty()) {
|
if ((*child)->type() == Node::Class) {
|
||||||
// Insert classes into the since and class maps.
|
// Insert classes into the since and class maps.
|
||||||
QString className = (*child)->name();
|
QString className = (*child)->name();
|
||||||
if ((*child)->parent() && (*child)->parent()->type() == Node::Namespace &&
|
if ((*child)->parent() && !(*child)->parent()->name().isEmpty()) {
|
||||||
!(*child)->parent()->name().isEmpty()) {
|
|
||||||
className = (*child)->parent()->name()+"::"+className;
|
className = (*child)->parent()->name()+"::"+className;
|
||||||
}
|
}
|
||||||
nsmap.value().insert(className,(*child));
|
nsmap.value().insert(className,(*child));
|
||||||
@ -481,8 +480,7 @@ void QDocDatabase::findAllSince(const InnerNode* node)
|
|||||||
else if ((*child)->subType() == Node::QmlClass) {
|
else if ((*child)->subType() == Node::QmlClass) {
|
||||||
// Insert QML elements into the since and element maps.
|
// Insert QML elements into the since and element maps.
|
||||||
QString className = (*child)->name();
|
QString className = (*child)->name();
|
||||||
if ((*child)->parent() && (*child)->parent()->type() == Node::Namespace &&
|
if ((*child)->parent() && !(*child)->parent()->name().isEmpty()) {
|
||||||
!(*child)->parent()->name().isEmpty()) {
|
|
||||||
className = (*child)->parent()->name()+"::"+className;
|
className = (*child)->parent()->name()+"::"+className;
|
||||||
}
|
}
|
||||||
nsmap.value().insert(className,(*child));
|
nsmap.value().insert(className,(*child));
|
||||||
@ -493,17 +491,15 @@ void QDocDatabase::findAllSince(const InnerNode* node)
|
|||||||
QString propertyName = (*child)->name();
|
QString propertyName = (*child)->name();
|
||||||
nsmap.value().insert(propertyName,(*child));
|
nsmap.value().insert(propertyName,(*child));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
// Insert external documents into the general since map.
|
// Insert external documents into the general since map.
|
||||||
QString name = (*child)->name();
|
QString name = (*child)->name();
|
||||||
if ((*child)->parent() && (*child)->parent()->type() == Node::Namespace &&
|
if ((*child)->parent() && !(*child)->parent()->name().isEmpty()) {
|
||||||
!(*child)->parent()->name().isEmpty()) {
|
|
||||||
name = (*child)->parent()->name()+"::"+name;
|
name = (*child)->parent()->name()+"::"+name;
|
||||||
}
|
}
|
||||||
nsmap.value().insert(name,(*child));
|
nsmap.value().insert(name,(*child));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Recursively find child nodes with since commands.
|
// Recursively find child nodes with since commands.
|
||||||
if ((*child)->isInnerNode()) {
|
if ((*child)->isInnerNode()) {
|
||||||
findAllSince(static_cast<InnerNode *>(*child));
|
findAllSince(static_cast<InnerNode *>(*child));
|
||||||
|
@ -50,13 +50,6 @@
|
|||||||
#include "generator.h"
|
#include "generator.h"
|
||||||
#include <qdebug.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
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -447,6 +440,11 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
|
|||||||
section->setUrl(indexUrl + QLatin1Char('/') + href);
|
section->setUrl(indexUrl + QLatin1Char('/') + href);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString since = element.attribute("since");
|
||||||
|
if (!since.isEmpty()) {
|
||||||
|
section->setSince(since);
|
||||||
|
}
|
||||||
|
|
||||||
// Create some content for the node.
|
// Create some content for the node.
|
||||||
QSet<QString> emptySet;
|
QSet<QString> emptySet;
|
||||||
Doc doc(location, location, " ", emptySet); // placeholder
|
Doc doc(location, location, " ", emptySet); // placeholder
|
||||||
@ -506,7 +504,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
|
|||||||
Node* node,
|
Node* node,
|
||||||
bool generateInternalNodes)
|
bool generateInternalNodes)
|
||||||
{
|
{
|
||||||
if (!node->url().isEmpty() || node->subType() == Node::DitaMap)
|
if (node->subType() == Node::DitaMap)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QString nodeName;
|
QString nodeName;
|
||||||
@ -646,6 +644,10 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
|
|||||||
if ((node->type() != Node::Document) && (!node->isQmlNode()))
|
if ((node->type() != Node::Document) && (!node->isQmlNode()))
|
||||||
writer.writeAttribute("location", node->location().fileName());
|
writer.writeAttribute("location", node->location().fileName());
|
||||||
|
|
||||||
|
if (!node->since().isEmpty()) {
|
||||||
|
writer.writeAttribute("since", node->since());
|
||||||
|
}
|
||||||
|
|
||||||
switch (node->type()) {
|
switch (node->type()) {
|
||||||
case Node::Class:
|
case Node::Class:
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user