summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2011-06-08 14:36:29 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2011-06-08 14:36:29 (GMT)
commit7b4e52045d17bcc4b3bb1e0973c3af2e48381c5e (patch)
tree4c7f1058633eef7c385dcb31fc2908baee0b692c /tools
parent9aa5f949f092032589917a0bfe16e78828d0dabe (diff)
downloadQt-7b4e52045d17bcc4b3bb1e0973c3af2e48381c5e.zip
Qt-7b4e52045d17bcc4b3bb1e0973c3af2e48381c5e.tar.gz
Qt-7b4e52045d17bcc4b3bb1e0973c3af2e48381c5e.tar.bz2
qdoc: Fixed code to match comments in QML files. Fixed API types.
Diffstat (limited to 'tools')
-rw-r--r--tools/qdoc3/qmlvisitor.cpp11
-rw-r--r--tools/qdoc3/qmlvisitor.h2
2 files changed, 6 insertions, 7 deletions
diff --git a/tools/qdoc3/qmlvisitor.cpp b/tools/qdoc3/qmlvisitor.cpp
index fe96f9a..98e188d 100644
--- a/tools/qdoc3/qmlvisitor.cpp
+++ b/tools/qdoc3/qmlvisitor.cpp
@@ -67,15 +67,15 @@ QmlDocVisitor::~QmlDocVisitor()
{
}
-QDeclarativeJS::AST::SourceLocation QmlDocVisitor::precedingComment(unsigned offset) const
+QDeclarativeJS::AST::SourceLocation QmlDocVisitor::precedingComment(quint32 offset) const
{
QDeclarativeJS::AST::SourceLocation currentLoc;
foreach (const QDeclarativeJS::AST::SourceLocation &loc, engine->comments()) {
- if (loc.begin() > lastEndOffset && loc.end() < offset)
- currentLoc = loc;
- else
+ if (loc.begin() >= offset)
break;
+ else if (loc.begin() > lastEndOffset && loc.end() < offset)
+ currentLoc = loc;
}
if (currentLoc.isValid()) {
QString comment = document.mid(currentLoc.offset, currentLoc.length);
@@ -195,7 +195,7 @@ bool QmlDocVisitor::visit(QDeclarativeJS::AST::UiPublicMember *member)
qmlPropGroup->setDefault();
QmlPropertyNode *qmlPropNode = new QmlPropertyNode(qmlPropGroup, name, type, false);
qmlPropNode->setWritable(!member->isReadonlyMember);
- applyDocumentation(member->firstSourceLocation(), qmlPropNode);
+ applyDocumentation(member->firstSourceLocation(), qmlPropGroup);
}
}
break;
@@ -204,7 +204,6 @@ bool QmlDocVisitor::visit(QDeclarativeJS::AST::UiPublicMember *member)
return false;
}
- //current->doc = precedingComment(member->firstSourceLocation().begin());
return true;
}
diff --git a/tools/qdoc3/qmlvisitor.h b/tools/qdoc3/qmlvisitor.h
index 34ed8c1..1d3a401 100644
--- a/tools/qdoc3/qmlvisitor.h
+++ b/tools/qdoc3/qmlvisitor.h
@@ -67,7 +67,7 @@ public:
bool visit(QDeclarativeJS::AST::IdentifierPropertyName *idproperty);
private:
- QDeclarativeJS::AST::SourceLocation precedingComment(unsigned offset) const;
+ QDeclarativeJS::AST::SourceLocation precedingComment(quint32 offset) const;
void applyDocumentation(QDeclarativeJS::AST::SourceLocation location, Node *node);
QDeclarativeJS::Engine *engine;