diff options
author | Martin Smith <martin.smith@nokia.com> | 2012-09-13 11:38:45 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-14 15:23:15 +0200 |
commit | 14f7eb86ca2275d91f284279af5f77205d4ae3c0 (patch) | |
tree | ed4e91d6422dd814ac3e81739ad4a3b55bf050c7 /src/tools/qdoc/codeparser.cpp | |
parent | 817a4474676b30a964de476d26bd70ddba3d379a (diff) |
qdoc: Refactoring of qdoc data structures
This commit is the beginning of a significant
overhaul of qdoc. A new class, QDocDatabase, is
added, which will eventually encapsulate all the
data structures used by qdoc. In this commit, the
Tree class is made private and only accessible
from QDocDatabase. Several maps structures are
also moved into QDocDatabase from other classes.
Much dead code and unused parameters were removed.
Further simplification will follow.
Change-Id: I237411c50f3ced0d2fc8d3b0fbfdf4e55880f8e9
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
Diffstat (limited to 'src/tools/qdoc/codeparser.cpp')
-rw-r--r-- | src/tools/qdoc/codeparser.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/tools/qdoc/codeparser.cpp b/src/tools/qdoc/codeparser.cpp index dbbb20ccfe..134b2f2616 100644 --- a/src/tools/qdoc/codeparser.cpp +++ b/src/tools/qdoc/codeparser.cpp @@ -48,6 +48,7 @@ #include "tree.h" #include "config.h" #include "generator.h" +#include "qdocdatabase.h" #include <qdebug.h> QT_BEGIN_NAMESPACE @@ -81,6 +82,7 @@ QMap<QString,QString> CodeParser::nameToTitle; */ CodeParser::CodeParser() { + qdb_ = QDocDatabase::qdocDB(); parsers.prepend(this); } @@ -114,16 +116,14 @@ QStringList CodeParser::headerFileNameFilter() return sourceFileNameFilter(); } -void CodeParser::parseHeaderFile(const Location& location, - const QString& filePath, - Tree *tree) +void CodeParser::parseHeaderFile(const Location& location, const QString& filePath) { - parseSourceFile(location, filePath, tree); + parseSourceFile(location, filePath); } -void CodeParser::doneParsingHeaderFiles(Tree *tree) +void CodeParser::doneParsingHeaderFiles() { - doneParsingSourceFiles(tree); + doneParsingSourceFiles(); } /*! @@ -230,8 +230,7 @@ QSet<QString> CodeParser::commonMetaCommands() void CodeParser::processCommonMetaCommand(const Location& location, const QString& command, const ArgLocPair& arg, - Node* node, - Tree* tree) + Node* node) { if (command == COMMAND_COMPAT) { location.warning(tr("\\compat command used, but Qt3 compatibility is no longer supported")); @@ -241,21 +240,16 @@ void CodeParser::processCommonMetaCommand(const Location& location, node->setStatus(Node::Deprecated); } else if (command == COMMAND_INGROUP) { - tree->addToGroup(node, arg.first); + qdb_->addToGroup(node, arg.first); } else if (command == COMMAND_INPUBLICGROUP) { - tree->addToPublicGroup(node, arg.first); + qdb_->addToPublicGroup(node, arg.first); } else if (command == COMMAND_INMODULE) { - node->setModuleName(arg.first); + qdb_->addToModule(arg.first,node); } else if (command == COMMAND_INQMLMODULE) { - node->setQmlModule(arg); - DocNode* fn = DocNode::lookupQmlModuleNode(tree, arg); - fn->addQmlModuleMember(node); - QString qmid = node->qmlModuleIdentifier(); - QmlClassNode* qcn = static_cast<QmlClassNode*>(node); - QmlClassNode::insertQmlModuleMember(qmid, qcn); + qdb_->addToQmlModule(arg.first,node); } else if (command == COMMAND_MAINCLASS) { node->setStatus(Node::Main); |