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 <casper.vandonderen@nokia.com>
This commit is contained in:
Martin Smith 2012-05-11 13:18:52 +02:00 committed by Qt by Nokia
parent 417fc1f759
commit 0909c01b2f
5 changed files with 19 additions and 37 deletions

View File

@ -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* )

View File

@ -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" ||

View File

@ -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),

View File

@ -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;

View File

@ -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
}
}