diff options
author | Martin Smith <martin.smith@digia.com> | 2012-10-05 14:35:00 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-08 09:12:20 +0200 |
commit | bac9d5921f0da609eedd72e371dae7c8321dc410 (patch) | |
tree | 02745b326af37af5c91b6bcec38fa9df1008d2df /src/tools/qdoc/qdocdatabase.h | |
parent | 50eab48fce0f5957ca09343448e018fb2f0cbfd9 (diff) |
qdoc: Simplification of target ref construction
This change is being done to simplify qdoc,
but the motivation was to fix a segfault in
qdoc when running the release version of
qdoc on linux. The change improves qdoc by
simplifying the code whether it fixes the
segfault or not.
Change-Id: I2c865f7f1e2a44763aa7349d1bd739ad562f4029
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Diffstat (limited to 'src/tools/qdoc/qdocdatabase.h')
-rw-r--r-- | src/tools/qdoc/qdocdatabase.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/tools/qdoc/qdocdatabase.h b/src/tools/qdoc/qdocdatabase.h index a9999549a3..6d104f303d 100644 --- a/src/tools/qdoc/qdocdatabase.h +++ b/src/tools/qdoc/qdocdatabase.h @@ -54,7 +54,7 @@ typedef QMap<QString, NodeMap> NodeMapMap; typedef QMap<QString, NodeMultiMap> NodeMultiMapMap; typedef QMultiMap<QString, Node*> QDocMultiMap; typedef QMap<Text, const Node*> TextToNodeMap; -typedef QMultiHash<QString, DocNode*> DocNodeHash; +typedef QMultiMap<QString, DocNode*> DocNodeMultiMap; class Atom; class Generator; @@ -70,11 +70,15 @@ class QDocDatabase struct Target { - Node* node; - Atom* atom; - int priority; + public: + Target() : node_(0), priority_(INT_MAX) { } + bool isEmpty() const { return ref_.isEmpty(); } + //void debug(int idx, const QString& key); + Node* node_; + QString ref_; + int priority_; }; - typedef QMultiHash<QString, Target> TargetHash; + typedef QMultiMap<QString, Target> TargetMultiMap; public: static QDocDatabase* qdocDB(); @@ -122,6 +126,7 @@ class QDocDatabase /* convenience functions Many of these will be either eliminated or replaced. */ + QString refForAtom(const Atom* atom); Tree* tree() { return tree_; } NamespaceNode* treeRoot() { return tree_->root(); } void resolveInheritance() { tree_->resolveInheritance(); } @@ -141,8 +146,8 @@ class QDocDatabase } const DocNode* findDocNodeByTitle(const QString& title, const Node* relative = 0) const; - const Node *findUnambiguousTarget(const QString &target, Atom *&atom, const Node* relative) const; - Atom *findTarget(const QString &target, const Node *node) const; + const Node *findUnambiguousTarget(const QString &target, QString& ref, const Node* relative) const; + QString findTarget(const QString &target, const Node *node) const; void resolveTargets(InnerNode* root); FunctionNode* findFunctionNode(const QStringList& parentPath, const FunctionNode* clone) { @@ -216,8 +221,8 @@ class QDocDatabase NodeMultiMapMap newSinceMaps_; NodeMapMap funcIndex_; TextToNodeMap legaleseTexts_; - TargetHash targetHash_; - DocNodeHash docNodesByTitle_; + TargetMultiMap targetMultiMap_; + DocNodeMultiMap docNodesByTitle_; }; QT_END_NAMESPACE |