summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Smith <[email protected]>2012-05-11 13:18:52 +0200
committerQt by Nokia <[email protected]>2012-05-11 15:11:20 +0200
commit0909c01b2f5d3a466fe6094a501a2893170e2616 (patch)
tree184c71a9b37da27785cd28b45b1c74482639ead9
parent417fc1f75929d7a6d2d25e0324c6b79d4b1cb530 (diff)
qdoc: Fixed a regression bug caused by fixing error messages
The C++ code marker is the default code marker. The default code marker was being called for .qdoc files. But when the tree nodes were each assigned a location object based on the location in the source file where the node was built, the default code marker was no longer used. Instead, the plain code marker was used. This was wrong. qdoc now knows to use the C++ code marker for all .qdoc files. Change-Id: I15a58168db74cc5aa82a1fbccc5b7ece219ec297 Reviewed-by: Casper van Donderen <[email protected]>
-rw-r--r--src/tools/qdoc/codemarker.cpp2
-rw-r--r--src/tools/qdoc/cppcodemarker.cpp1
-rw-r--r--src/tools/qdoc/cppcodeparser.cpp11
-rw-r--r--src/tools/qdoc/ditaxmlgenerator.cpp29
-rw-r--r--src/tools/qdoc/node.cpp13
5 files changed, 19 insertions, 37 deletions
diff --git a/src/tools/qdoc/codemarker.cpp b/src/tools/qdoc/codemarker.cpp
index fe0b366350a..00094a1a33f 100644
--- a/src/tools/qdoc/codemarker.cpp
+++ b/src/tools/qdoc/codemarker.cpp
@@ -682,7 +682,7 @@ QList<Section> CodeMarker::qmlSections(const QmlClassNode* ,
return QList<Section>();
}
-const Node* CodeMarker::resolveTarget(const QString& ,
+const Node* CodeMarker::resolveTarget(const QString& target,
const Tree* ,
const Node* ,
const Node* )
diff --git a/src/tools/qdoc/cppcodemarker.cpp b/src/tools/qdoc/cppcodemarker.cpp
index 165a235a86d..4e5a9eb5004 100644
--- a/src/tools/qdoc/cppcodemarker.cpp
+++ b/src/tools/qdoc/cppcodemarker.cpp
@@ -86,6 +86,7 @@ bool CppCodeMarker::recognizeExtension(const QString& extension)
QByteArray ext = extension.toLatin1();
return ext == "c" ||
ext == "c++" ||
+ ext == "qdoc" ||
ext == "cc" ||
ext == "cpp" ||
ext == "cxx" ||
diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp
index b77d6682d16..cf89bc02871 100644
--- a/src/tools/qdoc/cppcodeparser.cpp
+++ b/src/tools/qdoc/cppcodeparser.cpp
@@ -2538,11 +2538,12 @@ void CppCodeParser::createExampleFileNodes(FakeNode *fake)
exampleFiles += Config::getFilesHere(fullPath, "*.qrc *.pro *.qmlproject qmldir");
}
- foreach (const QString &exampleFile, exampleFiles)
- (void) new FakeNode(fake,
- exampleFile.mid(sizeOfBoringPartOfName),
- Node::File,
- Node::NoPageType);
+ foreach (const QString &exampleFile, exampleFiles) {
+ FakeNode* fn = new FakeNode(fake,
+ exampleFile.mid(sizeOfBoringPartOfName),
+ Node::File,
+ Node::NoPageType);
+ }
foreach (const QString &imageFile, imageFiles) {
new FakeNode(fake,
imageFile.mid(sizeOfBoringPartOfName),
diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp
index bed6e8a188f..7e55598c6e4 100644
--- a/src/tools/qdoc/ditaxmlgenerator.cpp
+++ b/src/tools/qdoc/ditaxmlgenerator.cpp
@@ -1327,16 +1327,12 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
{
const Node *node = 0;
QString myLink = getLink(atom, relative, marker, &node);
- if (myLink.isEmpty()) {
+ if (myLink.isEmpty())
myLink = getCollisionLink(atom);
- }
- if (myLink.isEmpty()) {
- relative->doc().location().warning(tr("Can't link to '%1'")
- .arg(atom->string()));
- }
- else if (!inSectionHeading) {
+ if (myLink.isEmpty())
+ relative->doc().location().warning(tr("Can't link to '%1'").arg(atom->string()));
+ else if (!inSectionHeading)
beginLink(myLink);
- }
skipAhead = 1;
}
break;
@@ -4237,25 +4233,20 @@ QString DitaXmlGenerator::getLink(const Atom* atom,
}
else {
*node = marker->resolveTarget(first, tree_, relative);
- if (!*node) {
+ if (!*node)
*node = tree_->findFakeNodeByTitle(first, relative);
- }
- if (!*node) {
+ if (!*node)
*node = tree_->findUnambiguousTarget(first, targetAtom, relative);
- }
}
if (*node) {
- if (!(*node)->url().isEmpty()) {
+ if (!(*node)->url().isEmpty())
return (*node)->url();
- }
- else {
+ else
path.removeFirst();
- }
}
- else {
+ else
*node = relative;
- }
if (*node && (*node)->status() == Node::Obsolete) {
if (relative && (relative->parent() != *node) &&
@@ -5747,7 +5738,6 @@ DitaXmlGenerator::generateInnerNode(InnerNode* node)
Obtain a code marker for the source file.
*/
CodeMarker *marker = CodeMarker::markerForFileName(node->location().filePath());
-
if (node->parent() != 0) {
/*
Skip name collision nodes here and process them
@@ -5908,7 +5898,6 @@ Node* DitaXmlGenerator::collectNodesByTypeAndSubtype(const InnerNode* parent)
nodeSubtypeMaps[Node::QmlModule]->insert(child->title(),child);
break;
case Node::Collision:
- qDebug() << "FAKE NODE: Collision";
if (!isDuplicate(nodeSubtypeMaps[Node::Collision],child->title(),child))
nodeSubtypeMaps[Node::Collision]->insert(child->title(),child);
break;
diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp
index f235753ccd2..51d706528db 100644
--- a/src/tools/qdoc/node.cpp
+++ b/src/tools/qdoc/node.cpp
@@ -2029,7 +2029,7 @@ QmlClassNode::QmlClassNode(InnerNode *parent,
{
int i = 0;
if (name.startsWith("QML:")) {
- qDebug() << "BOGUS:" << name;
+ qDebug() << "BOGUS QML qualifier:" << name;
i = 4;
}
setTitle(name.mid(i));
@@ -2040,9 +2040,7 @@ QmlClassNode::QmlClassNode(InnerNode *parent,
*/
QmlClassNode::~QmlClassNode()
{
-#ifdef DEBUG_MULTIPLE_QDOCCONF_FILES
- qDebug() << "Deleting QmlClassNode:" << name();
-#endif
+ // nothing.
}
/*!
@@ -2094,9 +2092,6 @@ void QmlClassNode::addInheritedBy(const QString& base, Node* sub)
if (inheritedBy.find(base,sub) == inheritedBy.end()) {
inheritedBy.insert(base,sub);
}
-#ifdef DEBUG_MULTIPLE_QDOCCONF_FILES
- qDebug() << "QmlClassNode::addInheritedBy(): insert" << base << sub->name() << inheritedBy.size();
-#endif
}
/*!
@@ -2107,10 +2102,6 @@ void QmlClassNode::subclasses(const QString& base, NodeList& subs)
subs.clear();
if (inheritedBy.count(base) > 0) {
subs = inheritedBy.values(base);
-#ifdef DEBUG_MULTIPLE_QDOCCONF_FILES
- qDebug() << "QmlClassNode::subclasses():" << inheritedBy.count(base) << base
- << "subs:" << subs.size() << "total size:" << inheritedBy.size();
-#endif
}
}