summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/generator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/qdoc/generator.cpp')
-rw-r--r--src/tools/qdoc/generator.cpp302
1 files changed, 199 insertions, 103 deletions
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp
index 7f0d4b48b9..dc731f0121 100644
--- a/src/tools/qdoc/generator.cpp
+++ b/src/tools/qdoc/generator.cpp
@@ -63,6 +63,7 @@ QString Generator::outSubdir_;
QStringList Generator::outFileNames_;
QSet<QString> Generator::outputFormats;
QHash<QString, QString> Generator::outputPrefixes;
+QHash<QString, QString> Generator::outputSuffixes;
QString Generator::project_;
QStringList Generator::scriptDirs;
QStringList Generator::scriptFiles;
@@ -259,7 +260,7 @@ void Generator::writeOutFileNames()
Attaches a QTextStream to the created file, which is written
to all over the place using out().
*/
-void Generator::beginSubPage(const InnerNode* node, const QString& fileName)
+void Generator::beginSubPage(const Aggregate* node, const QString& fileName)
{
QString path = outputDir() + QLatin1Char('/');
if (Generator::useOutputSubdirs() && !node->outputSubdirectory().isEmpty() &&
@@ -281,7 +282,7 @@ void Generator::beginSubPage(const InnerNode* node, const QString& fileName)
out->setCodec(outputCodec);
#endif
outStreamStack.push(out);
- const_cast<InnerNode*>(node)->setOutputFileName(fileName);
+ const_cast<Aggregate*>(node)->setOutputFileName(fileName);
}
/*!
@@ -300,7 +301,7 @@ QString Generator::fileBase(const Node *node) const
{
if (node->relates())
node = node->relates();
- else if (!node->isInnerNode())
+ else if (!node->isAggregate())
node = node->parent();
if (node->type() == Node::QmlPropertyGroup) {
node = node->parent();
@@ -329,21 +330,21 @@ QString Generator::fileBase(const Node *node) const
else if (node->isQmlType() || node->isQmlBasicType() ||
node->isJsType() || node->isJsBasicType()) {
base = node->name();
- if (!node->logicalModuleName().isEmpty()) {
- base.prepend(node->logicalModuleName() + QLatin1Char('-'));
- }
/*
To avoid file name conflicts in the html directory,
- we prepend a prefix (by default, "qml-") to the file name of QML
- element doc files.
+ we prepend a prefix (by default, "qml-") and an optional suffix
+ to the file name. The suffix, if one exists, is appended to the
+ module name.
*/
- if (node->isQmlType() || node->isQmlBasicType())
- base.prepend(outputPrefix(QLatin1String("QML")));
- else
- base.prepend(outputPrefix(QLatin1String("JS")));
+ if (!node->logicalModuleName().isEmpty()) {
+ base.prepend(node->logicalModuleName()
+ + outputSuffix(node)
+ + QLatin1Char('-'));
+ }
+ base.prepend(outputPrefix(node));
}
else if (node->isCollectionNode()) {
- base = node->name();
+ base = node->name() + outputSuffix(node);
if (base.endsWith(".html"))
base.truncate(base.length() - 5);
@@ -356,7 +357,7 @@ QString Generator::fileBase(const Node *node) const
else if (node->isModule()) {
base.append("-module");
}
- // Why not add "-group" for gropup pages?
+ // Why not add "-group" for group pages?
}
else {
const Node *p = node;
@@ -519,9 +520,7 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir)
else if (node->isQmlType() || node->isQmlBasicType() ||
node->isJsType() || node->isJsBasicType()) {
QString fb = fileBase(node);
- if (fb.startsWith(Generator::outputPrefix(QLatin1String("QML"))))
- return fb + QLatin1Char('.') + currentGenerator()->fileExtension();
- else if (fb.startsWith(Generator::outputPrefix(QLatin1String("JS"))))
+ if (fb.startsWith(outputPrefix(node)))
return fb + QLatin1Char('.') + currentGenerator()->fileExtension();
else {
QString mq;
@@ -529,10 +528,7 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir)
mq = node->logicalModuleName().replace(QChar('.'),QChar('-'));
mq = mq.toLower() + QLatin1Char('-');
}
- QLatin1String prefix = QLatin1String("QML");
- if (node->isJsType() || node->isJsBasicType())
- prefix = QLatin1String("JS");
- return fdl+ Generator::outputPrefix(prefix) + mq + fileBase(node) +
+ return fdl + outputPrefix(node) + mq + fileBase(node) +
QLatin1Char('.') + currentGenerator()->fileExtension();
}
}
@@ -564,20 +560,19 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir)
break;
case Node::Function:
{
- const FunctionNode *functionNode =
- static_cast<const FunctionNode *>(node);
+ const FunctionNode *fn = static_cast<const FunctionNode *>(node);
- if (functionNode->metaness() == FunctionNode::Dtor)
- anchorRef = "#dtor." + functionNode->name().mid(1);
+ if (fn->metaness() == FunctionNode::Dtor)
+ anchorRef = "#dtor." + fn->name().mid(1);
- else if (functionNode->associatedProperty())
- return fullDocumentLocation(functionNode->associatedProperty());
+ else if (fn->hasOneAssociatedProperty() && fn->doc().isEmpty())
+ return fullDocumentLocation(fn->firstAssociatedProperty());
- else if (functionNode->overloadNumber() > 1)
- anchorRef = QLatin1Char('#') + cleanRef(functionNode->name())
- + QLatin1Char('-') + QString::number(functionNode->overloadNumber());
+ else if (fn->overloadNumber() > 0)
+ anchorRef = QLatin1Char('#') + cleanRef(fn->name())
+ + QLatin1Char('-') + QString::number(fn->overloadNumber());
else
- anchorRef = QLatin1Char('#') + cleanRef(functionNode->name());
+ anchorRef = QLatin1Char('#') + cleanRef(fn->name());
break;
}
/*
@@ -750,12 +745,12 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
if (node->type() == Node::Document) {
const DocumentNode *dn = static_cast<const DocumentNode *>(node);
- if ((dn->subType() == Node::File) || (dn->subType() == Node::Image)) {
+ if ((dn->docSubtype() == Node::File) || (dn->docSubtype() == Node::Image)) {
quiet = true;
}
}
if (node->doc().isEmpty()) {
- if (!node->isWrapper() && !quiet && !node->isReimp()) { // ### might be unnecessary
+ if (!node->isWrapper() && !quiet && !node->isReimplemented()) { // ### might be unnecessary
node->location().warning(tr("No documentation for '%1'").arg(node->plainFullName()));
}
}
@@ -767,7 +762,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
}
if (!generateText(node->doc().body(), node, marker)) {
- if (node->isReimp())
+ if (node->isReimplemented())
return;
}
@@ -809,9 +804,10 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
else if (node->type() == Node::Function) {
const FunctionNode *func = static_cast<const FunctionNode *>(node);
QSet<QString> definedParams;
- QList<Parameter>::ConstIterator p = func->parameters().constBegin();
+ QVector<Parameter>::ConstIterator p = func->parameters().constBegin();
while (p != func->parameters().constEnd()) {
- if ((*p).name().isEmpty() && (*p).leftType() != QLatin1String("...")
+ if ((*p).name().isEmpty() && (*p).dataType() != QLatin1String("...")
+ && (*p).dataType() != QLatin1String("void")
&& func->name() != QLatin1String("operator++")
&& func->name() != QLatin1String("operator--")) {
node->doc().location().warning(tr("Missing parameter name"));
@@ -840,9 +836,8 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
}
else if (!(*a).isEmpty() && !documentedParams.contains(*a)) {
bool needWarning = (func->status() > Node::Obsolete);
- if (func->overloadNumber() > 1) {
- FunctionNode *primaryFunc =
- func->parent()->findFunctionNode(func->name());
+ if (func->overloadNumber() > 0) {
+ FunctionNode *primaryFunc = func->parent()->findFunctionNode(func->name(), QString());
if (primaryFunc) {
foreach (const Parameter &param,
primaryFunc->parameters()) {
@@ -853,7 +848,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
}
}
}
- if (needWarning && !func->isReimp())
+ if (needWarning && !func->isReimplemented())
node->doc().location().warning(
tr("Undocumented parameter '%1' in %2")
.arg(*a).arg(node->plainFullName()));
@@ -879,7 +874,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
if (dn->isExample()) {
generateExampleFiles(dn, marker);
}
- else if (dn->subType() == Node::File) {
+ else if (dn->docSubtype() == Node::File) {
Text text;
Quoter quoter;
Doc::quoteFromFile(dn->doc().location(), quoter, dn->name());
@@ -891,7 +886,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
}
}
-void Generator::generateClassLikeNode(InnerNode* /* classe */, CodeMarker* /* marker */)
+void Generator::generateClassLikeNode(Aggregate* /* classe */, CodeMarker* /* marker */)
{
}
@@ -920,7 +915,7 @@ void Generator::generateCollectionNode(CollectionNode* , CodeMarker* )
*/
void Generator::generateFileList(const DocumentNode* dn,
CodeMarker* marker,
- Node::SubType subtype,
+ Node::DocSubtype subtype,
const QString& tag)
{
int count = 0;
@@ -931,7 +926,7 @@ void Generator::generateFileList(const DocumentNode* dn,
<< Atom(Atom::ListLeft, openedList.styleString());
foreach (const Node* child, dn->childNodes()) {
- if (child->subType() == subtype) {
+ if (child->docSubtype() == subtype) {
++count;
QString file = child->name();
if (subtype == Node::Image) {
@@ -947,16 +942,10 @@ void Generator::generateFileList(const DocumentNode* dn,
userFriendlyFilePath);
outFileNames_ << prefix.mid(1) + userFriendlyFilePath;
userFriendlyFilePath.truncate(userFriendlyFilePath.lastIndexOf('/'));
-
QString imgOutDir = outDir_ + prefix + userFriendlyFilePath;
if (!dirInfo.mkpath(imgOutDir))
- dn->location().fatal(tr("Cannot create output directory '%1'")
- .arg(imgOutDir));
-
- QString imgOutName = Config::copyFile(dn->location(),
- srcPath,
- file,
- imgOutDir);
+ dn->location().fatal(tr("Cannot create output directory '%1'").arg(imgOutDir));
+ Config::copyFile(dn->location(), srcPath, file, imgOutDir);
}
}
@@ -1032,7 +1021,7 @@ void Generator::generateInherits(const ClassNode *classe, CodeMarker *marker)
/*!
Recursive writing of HTML files from the root \a node.
*/
-void Generator::generateInnerNode(InnerNode* node)
+void Generator::generateAggregate(Aggregate* node)
{
if (!node->url().isNull())
return;
@@ -1043,11 +1032,11 @@ void Generator::generateInnerNode(InnerNode* node)
if (node->isDocumentNode()) {
DocumentNode* docNode = static_cast<DocumentNode*>(node);
- if (docNode->subType() == Node::ExternalPage)
+ if (docNode->docSubtype() == Node::ExternalPage)
return;
- if (docNode->subType() == Node::Image)
+ if (docNode->docSubtype() == Node::Image)
return;
- if (docNode->subType() == Node::Page) {
+ if (docNode->docSubtype() == Node::Page) {
if (node->count() > 0)
qDebug("PAGE %s HAS CHILDREN", qPrintable(docNode->title()));
}
@@ -1117,8 +1106,8 @@ void Generator::generateInnerNode(InnerNode* node)
int i = 0;
while (i < node->childNodes().count()) {
Node *c = node->childNodes().at(i);
- if (c->isInnerNode() && c->access() != Node::Private) {
- generateInnerNode((InnerNode*)c);
+ if (c->isAggregate() && c->access() != Node::Private) {
+ generateAggregate((Aggregate*)c);
}
++i;
}
@@ -1127,7 +1116,7 @@ void Generator::generateInnerNode(InnerNode* node)
/*!
Generate a list of maintainers in the output
*/
-void Generator::generateMaintainerList(const InnerNode* node, CodeMarker* marker)
+void Generator::generateMaintainerList(const Aggregate* node, CodeMarker* marker)
{
QStringList sl = getMetadataElements(node,"maintainer");
@@ -1252,7 +1241,8 @@ void Generator::generateStatus(const Node *node, CodeMarker *marker)
Text text;
switch (node->status()) {
- case Node::Commendable:
+ case Node::Active:
+ // Do nothing.
break;
case Node::Preliminary:
text << Atom::ParaLeft
@@ -1265,19 +1255,19 @@ void Generator::generateStatus(const Node *node, CodeMarker *marker)
break;
case Node::Deprecated:
text << Atom::ParaLeft;
- if (node->isInnerNode())
+ if (node->isAggregate())
text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD);
text << "This " << typeString(node) << " is deprecated.";
- if (node->isInnerNode())
+ if (node->isAggregate())
text << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD);
text << Atom::ParaRight;
break;
case Node::Obsolete:
text << Atom::ParaLeft;
- if (node->isInnerNode())
+ if (node->isAggregate())
text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD);
text << "This " << typeString(node) << " is obsolete.";
- if (node->isInnerNode())
+ if (node->isAggregate())
text << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD);
text << " It is provided to keep old source code working. "
<< "We strongly advise against "
@@ -1285,7 +1275,7 @@ void Generator::generateStatus(const Node *node, CodeMarker *marker)
break;
case Node::Compat:
// reimplemented in HtmlGenerator subclass
- if (node->isInnerNode()) {
+ if (node->isAggregate()) {
text << Atom::ParaLeft
<< Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD)
<< "This "
@@ -1384,8 +1374,8 @@ void Generator::generateThreadSafeness(const Node *node, CodeMarker *marker)
<< Atom(Atom::FormattingRight,ATOM_FORMATTING_BOLD)
<< " ";
- if (node->isInnerNode()) {
- const InnerNode* innerNode = static_cast<const InnerNode*>(node);
+ if (node->isAggregate()) {
+ const Aggregate* innerNode = static_cast<const Aggregate*>(node);
text << "All functions in this "
<< typeString(node)
<< " are ";
@@ -1485,11 +1475,80 @@ void Generator::generateThreadSafeness(const Node *node, CodeMarker *marker)
}
/*!
- Traverses the current tree to generate all the documentation.
+ If the node is an overloaded signal, and a node with an example on how to connect to it
+ */
+void Generator::generateOverloadedSignal(const Node* node, CodeMarker* marker)
+{
+ if (node->type() != Node::Function)
+ return;
+ const FunctionNode *func = static_cast<const FunctionNode *>(node);
+ if (func->metaness() != FunctionNode::Signal)
+ return;
+ if (node->parent()->overloads(node->name()).count() <= 1)
+ return;
+
+
+ // Compute a friendly name for the object of that instance.
+ // e.g: "QAbstractSocket" -> "abstractSocket"
+ QString objectName = node->parent()->name();
+ if (objectName.size() >= 2) {
+ if (objectName[0] == 'Q')
+ objectName = objectName.mid(1);
+ objectName[0] = objectName[0].toLower();
+ }
+
+
+ // We have an overloaded signal, show an example
+ QString code = "connect(" + objectName + ", static_cast<" + func->returnType()
+ + "(" + func->parent()->name() + "::*)(";
+ for (int i = 0; i < func->parameters().size(); ++i) {
+ if (i != 0)
+ code += ", ";
+ const Parameter &p = func->parameters().at(i);
+ code += p.dataType() + p.rightType();
+ }
+
+ code += ")";
+ if (func->isConst())
+ code += " const";
+ code += ">(&" + func->parent()->name() + "::" + func->name() + "),\n [=](";
+
+ for (int i = 0; i < func->parameters().size(); ++i) {
+ if (i != 0)
+ code += ", ";
+ const Parameter &p = func->parameters().at(i);
+ code += p.dataType();
+ if (code[code.size()-1].isLetterOrNumber())
+ code += " ";
+ code += p.name() + p.rightType();
+ }
+
+ code += "){ /* ... */ });";
+
+ Text text;
+ text << Atom::ParaLeft
+ << Atom(Atom::FormattingLeft,ATOM_FORMATTING_BOLD)
+ << "Note:"
+ << Atom(Atom::FormattingRight,ATOM_FORMATTING_BOLD)
+ << "Signal "
+ << Atom(Atom::FormattingLeft,ATOM_FORMATTING_ITALIC)
+ << node->name()
+ << Atom(Atom::FormattingRight,ATOM_FORMATTING_ITALIC)
+ << " is overloaded in this class. "
+ "To connect to this one using the function pointer syntax, you must "
+ "specify the signal type in a static cast, as shown in this example:"
+ << Atom(Atom::Code, marker->markedUpCode(code, node, func->location()));
+
+ generateText(text, node, marker);
+}
+
+
+/*!
+ Traverses the database recursivly to generate all the documentation.
*/
void Generator::generateDocs()
{
- generateInnerNode(qdb_->primaryTreeRoot());
+ generateAggregate(qdb_->primaryTreeRoot());
}
Generator *Generator::generatorForFormat(const QString& format)
@@ -1512,7 +1571,7 @@ Generator *Generator::generatorForFormat(const QString& format)
i.e. Once you call this function for a particular \a t,
you consume \a t.
*/
-QString Generator::getMetadataElement(const InnerNode* inner, const QString& t)
+QString Generator::getMetadataElement(const Aggregate* inner, const QString& t)
{
QString s;
QStringMultiMap& metaTagMap = const_cast<QStringMultiMap&>(inner->doc().metaTagMap());
@@ -1533,7 +1592,7 @@ QString Generator::getMetadataElement(const InnerNode* inner, const QString& t)
having the key \a t are erased. i.e. Once you call this
function for a particular \a t, you consume \a t.
*/
-QStringList Generator::getMetadataElements(const InnerNode* inner, const QString& t)
+QStringList Generator::getMetadataElements(const Aggregate* inner, const QString& t)
{
QStringList s;
QStringMultiMap& metaTagMap = const_cast<QStringMultiMap&>(inner->doc().metaTagMap());
@@ -1628,12 +1687,6 @@ void Generator::initialize(const Config &config)
if (!dirInfo.exists(outDir_ + "/images") && !dirInfo.mkdir(outDir_ + "/images"))
config.lastLocation().fatal(tr("Cannot create images directory '%1'").arg(outDir_ + "/images"));
- if (!dirInfo.exists(outDir_ + "/images/used-in-examples") && !dirInfo.mkdir(outDir_ + "/images/used-in-examples"))
- config.lastLocation().fatal(tr("Cannot create images used in examples directory '%1'").arg(outDir_ + "/images/used-in-examples"));
- if (!dirInfo.exists(outDir_ + "/scripts") && !dirInfo.mkdir(outDir_ + "/scripts"))
- config.lastLocation().fatal(tr("Cannot create scripts directory '%1'").arg(outDir_ + "/scripts"));
- if (!dirInfo.exists(outDir_ + "/style") && !dirInfo.mkdir(outDir_ + "/style"))
- config.lastLocation().fatal(tr("Cannot create style directory '%1'").arg(outDir_ + "/style"));
}
imageFiles = config.getCanonicalPathList(CONFIG_IMAGES);
@@ -1672,23 +1725,41 @@ void Generator::initialize(const Config &config)
// Documentation template handling
QStringList scripts = config.getCanonicalPathList((*g)->format()+Config::dot+CONFIG_SCRIPTS, true);
- e = scripts.constBegin();
- while (e != scripts.constEnd()) {
- QString filePath = *e;
- if (!filePath.isEmpty())
- Config::copyFile(config.lastLocation(), filePath, filePath,
- (*g)->outputDir() + "/scripts");
- ++e;
+ if (!scripts.isEmpty()) {
+ QDir dirInfo;
+ if (!dirInfo.exists(outDir_ + "/scripts") && !dirInfo.mkdir(outDir_ + "/scripts")) {
+ config.lastLocation().fatal(tr("Cannot create scripts directory '%1'")
+ .arg(outDir_ + "/scripts"));
+ }
+ else {
+ e = scripts.constBegin();
+ while (e != scripts.constEnd()) {
+ QString filePath = *e;
+ if (!filePath.isEmpty())
+ Config::copyFile(config.lastLocation(), filePath, filePath,
+ (*g)->outputDir() + "/scripts");
+ ++e;
+ }
+ }
}
QStringList styles = config.getCanonicalPathList((*g)->format()+Config::dot+CONFIG_STYLESHEETS, true);
- e = styles.constBegin();
- while (e != styles.constEnd()) {
- QString filePath = *e;
- if (!filePath.isEmpty())
- Config::copyFile(config.lastLocation(), filePath, filePath,
- (*g)->outputDir() + "/style");
- ++e;
+ if (!styles.isEmpty()) {
+ QDir dirInfo;
+ if (!dirInfo.exists(outDir_ + "/style") && !dirInfo.mkdir(outDir_ + "/style")) {
+ config.lastLocation().fatal(tr("Cannot create style directory '%1'")
+ .arg(outDir_ + "/style"));
+ }
+ else {
+ e = styles.constBegin();
+ while (e != styles.constEnd()) {
+ QString filePath = *e;
+ if (!filePath.isEmpty())
+ Config::copyFile(config.lastLocation(), filePath, filePath,
+ (*g)->outputDir() + "/style");
+ ++e;
+ }
+ }
}
}
++g;
@@ -1732,15 +1803,24 @@ void Generator::initialize(const Config &config)
project_ = config.getString(CONFIG_PROJECT);
- QStringList prefixes = config.getStringList(CONFIG_OUTPUTPREFIXES);
- if (!prefixes.isEmpty()) {
- foreach (const QString &prefix, prefixes)
+ outputPrefixes.clear();
+ QStringList items = config.getStringList(CONFIG_OUTPUTPREFIXES);
+ if (!items.isEmpty()) {
+ foreach (const QString &prefix, items)
outputPrefixes[prefix] = config.getString(CONFIG_OUTPUTPREFIXES + Config::dot + prefix);
}
else {
outputPrefixes[QLatin1String("QML")] = QLatin1String("qml-");
outputPrefixes[QLatin1String("JS")] = QLatin1String("js-");
}
+
+ outputSuffixes.clear();
+ items = config.getStringList(CONFIG_OUTPUTSUFFIXES);
+ if (!items.isEmpty()) {
+ foreach (const QString &suffix, items)
+ outputSuffixes[suffix] = config.getString(CONFIG_OUTPUTSUFFIXES + Config::dot + suffix);
+ }
+
noLinkErrors_ = config.getBool(CONFIG_NOLINKERRORS);
autolinkErrors_ = config.getBool(CONFIG_AUTOLINKERRORS);
}
@@ -1770,7 +1850,7 @@ void Generator::initializeGenerator(const Config& config)
singleExec_ = config.getBool(CONFIG_SINGLEEXEC);
}
-bool Generator::matchAhead(const Atom *atom, Atom::Type expectedAtomType)
+bool Generator::matchAhead(const Atom *atom, Atom::AtomType expectedAtomType)
{
return atom->next() != 0 && atom->next()->type() == expectedAtomType;
}
@@ -1790,9 +1870,25 @@ QString Generator::outFileName()
return QFileInfo(static_cast<QFile*>(out().device())->fileName()).fileName();
}
-QString Generator::outputPrefix(const QString &nodeType)
+QString Generator::outputPrefix(const Node *node)
+{
+ // Prefix is applied to QML and JS types
+ if (node->isQmlType() || node->isQmlBasicType())
+ return outputPrefixes[QLatin1String("QML")];
+ if (node->isJsType() || node->isJsBasicType())
+ return outputPrefixes[QLatin1String("JS")];
+ return QString();
+}
+
+QString Generator::outputSuffix(const Node *node)
{
- return outputPrefixes[nodeType];
+ // Suffix is applied to QML and JS types, as
+ // well as module pages.
+ if (node->isQmlModule() || node->isQmlType() || node->isQmlBasicType())
+ return outputSuffixes[QLatin1String("QML")];
+ if (node->isJsModule() || node->isJsType() || node->isJsBasicType())
+ return outputSuffixes[QLatin1String("JS")];
+ return QString();
}
bool Generator::parseArg(const QString& src,
@@ -1917,7 +2013,7 @@ void Generator::singularPlural(Text& text, const NodeList& nodes)
text << " are";
}
-int Generator::skipAtoms(const Atom *atom, Atom::Type type) const
+int Generator::skipAtoms(const Atom *atom, Atom::AtomType type) const
{
int skipAhead = 0;
atom = atom->next();
@@ -1947,21 +2043,21 @@ void Generator::supplementAlsoList(const Node *node, QList<Text> &alsoList)
{
if (node->type() == Node::Function) {
const FunctionNode *func = static_cast<const FunctionNode *>(node);
- if (func->overloadNumber() == 1) {
+ if (func->overloadNumber() == 0) {
QString alternateName;
const FunctionNode *alternateFunc = 0;
if (func->name().startsWith("set") && func->name().size() >= 4) {
alternateName = func->name()[3].toLower();
alternateName += func->name().mid(4);
- alternateFunc = func->parent()->findFunctionNode(alternateName);
+ alternateFunc = func->parent()->findFunctionNode(alternateName, QString());
if (!alternateFunc) {
alternateName = "is" + func->name().mid(3);
- alternateFunc = func->parent()->findFunctionNode(alternateName);
+ alternateFunc = func->parent()->findFunctionNode(alternateName, QString());
if (!alternateFunc) {
alternateName = "has" + func->name().mid(3);
- alternateFunc = func->parent()->findFunctionNode(alternateName);
+ alternateFunc = func->parent()->findFunctionNode(alternateName, QString());
}
}
}
@@ -1969,7 +2065,7 @@ void Generator::supplementAlsoList(const Node *node, QList<Text> &alsoList)
alternateName = "set";
alternateName += func->name()[0].toUpper();
alternateName += func->name().mid(1);
- alternateFunc = func->parent()->findFunctionNode(alternateName);
+ alternateFunc = func->parent()->findFunctionNode(alternateName, QString());
}
if (alternateFunc && alternateFunc->access() != Node::Private) {