summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/tools/qdoc/generator.cpp63
-rw-r--r--src/tools/qdoc/qdocdatabase.cpp14
-rw-r--r--src/tools/qdoc/qdocindexfiles.cpp3
3 files changed, 44 insertions, 36 deletions
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp
index 5583600bf6..cfea6235d3 100644
--- a/src/tools/qdoc/generator.cpp
+++ b/src/tools/qdoc/generator.cpp
@@ -314,34 +314,12 @@ QString Generator::fileBase(const Node *node) const
return fileBase(ncn->currentChild());
}
- if (node->hasBaseName()) {
- //qDebug() << "RETURNING:" << node->baseName();
+ if (node->hasBaseName())
return node->baseName();
- }
QString base;
- const Node *p = node;
-
- forever {
- const Node *pp = p->parent();
- base.prepend(p->name());
- if (!p->qmlModuleIdentifier().isEmpty())
- base.prepend(p->qmlModuleIdentifier()+QChar('-'));
- /*
- 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.
- */
- if ((p->subType() == Node::QmlClass) ||
- (p->subType() == Node::QmlBasicType)) {
- base.prepend(outputPrefix(QLatin1String("QML")));
- }
- if (!pp || pp->name().isEmpty() || pp->type() == Node::Document)
- break;
- base.prepend(QLatin1Char('-'));
- p = pp;
- }
if (node->type() == Node::Document) {
+ base = node->name();
if (node->subType() == Node::Collision) {
const NameCollisionNode* ncn = static_cast<const NameCollisionNode*>(node);
if (ncn->currentChild())
@@ -352,17 +330,42 @@ QString Generator::fileBase(const Node *node) const
if (base.endsWith(".html"))
base.truncate(base.length() - 5);
- if (node->subType() == Node::QmlModule) {
- base.prepend("qmlmodule-");
+ if (node->isQmlNode()) {
+ if (!node->qmlModuleName().isEmpty()) {
+ base.prepend(node->qmlModuleName() + 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.
+ */
+ if ((node->subType() == Node::QmlClass) || (node->subType() == Node::QmlBasicType)) {
+ base.prepend(outputPrefix(QLatin1String("QML")));
+ }
+ }
+ }
+ else if (node->subType() == Node::QmlModule) {
+ base.append("-qmlmodule");
}
- if (node->subType() == Node::Module) {
+ else if (node->subType() == Node::Module) {
base.append("-module");
}
- if (node->isExample() || node->isExampleFile())
+ if (node->isExample() || node->isExampleFile()) {
base.prepend(project.toLower() + QLatin1Char('-'));
- if (node->isExample())
+ }
+ if (node->isExample()) {
base.append(QLatin1String("-example"));
-
+ }
+ }
+ else {
+ const Node *p = node;
+ forever {
+ const Node *pp = p->parent();
+ base.prepend(p->name());
+ if (!pp || pp->name().isEmpty() || pp->type() == Node::Document)
+ break;
+ base.prepend(QLatin1Char('-'));
+ p = pp;
+ }
}
// the code below is effectively equivalent to:
diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp
index a1e06c8020..f1a92c2eb3 100644
--- a/src/tools/qdoc/qdocdatabase.cpp
+++ b/src/tools/qdoc/qdocdatabase.cpp
@@ -190,17 +190,19 @@ DocNode* QDocDatabase::findQmlModule(const QString& name)
QStringList dotSplit;
QStringList blankSplit = name.split(QLatin1Char(' '));
QString qmid = blankSplit[0];
+ QString qmlModuleName = qmid;
if (blankSplit.size() > 1) {
dotSplit = blankSplit[1].split(QLatin1Char('.'));
qmid += dotSplit[0];
}
DocNode* dn = 0;
- if (qmlModules_.contains(qmid))
- return qmlModules_.value(qmid);
- dn = new DocNode(tree_->root(), name, Node::QmlModule, Node::OverviewPage);
+ if (qmlModules_.contains(qmlModuleName))
+ return qmlModules_.value(qmlModuleName);
+ dn = new DocNode(tree_->root(), qmlModuleName, Node::QmlModule, Node::OverviewPage);
dn->markNotSeen();
dn->setQmlModuleInfo(name);
- qmlModules_.insert(qmid,dn);
+ qmlModules_.insert(qmlModuleName,dn);
+ masterMap_.insert(qmlModuleName,dn);
masterMap_.insert(qmid,dn);
masterMap_.insert(dn->name(),dn);
return dn;
@@ -923,8 +925,10 @@ const DocNode* QDocDatabase::findDocNodeByTitle(const QString& title, const Node
if (j != docNodesByTitle_.constEnd() && j.key() == i.key()) {
QList<Location> internalLocations;
while (j != docNodesByTitle_.constEnd()) {
- if (j.key() == i.key() && j.value()->url().isEmpty())
+ if (j.key() == i.key() && j.value()->url().isEmpty()) {
internalLocations.append(j.value()->location());
+ break; // Just report one duplicate for now.
+ }
++j;
}
if (internalLocations.size() > 0) {
diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp
index 3283e978f4..cb387a9452 100644
--- a/src/tools/qdoc/qdocindexfiles.cpp
+++ b/src/tools/qdoc/qdocindexfiles.cpp
@@ -195,7 +195,8 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
qcn->setTitle(element.attribute("title"));
QString qmlModuleName = element.attribute("qml-module-name");
QString qmlModuleVersion = element.attribute("qml-module-version");
- qdb_->addToQmlModule(qmlModuleName + " " + qmlModuleVersion, qcn);
+ if (!qmlModuleName.isEmpty())
+ qdb_->addToQmlModule(qmlModuleName + " " + qmlModuleVersion, qcn);
QString qmlFullBaseName = element.attribute("qml-base-type");
if (!qmlFullBaseName.isEmpty())
qcn->setQmlBaseName(qmlFullBaseName);