diff options
author | Martin Smith <martin.smith@digia.com> | 2012-12-11 14:53:29 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-12 10:55:28 +0100 |
commit | f03f8431ef19606940a528e903c0d0cb82264c94 (patch) | |
tree | 69687c91cd1ec2f12a00438da956a5122b30bd60 /src/tools/qdoc/qdocdatabase.h | |
parent | 0549a4b6f52e6929daec4b0c97df2085739bc719 (diff) |
qdoc: Make links to \target work intermodule
\target sets up a unique target that should be
accessible with \l across module boundaries.
This was not working across module boundaries.
Now it has been fixed, and it is one way of
handling the problem described in the referenced
bug report.
Task-number: QTBUG-28244
Change-Id: I541f409b998f84b2b8dcf66751762cf07f9f108b
Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Diffstat (limited to 'src/tools/qdoc/qdocdatabase.h')
-rw-r--r-- | src/tools/qdoc/qdocdatabase.h | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/tools/qdoc/qdocdatabase.h b/src/tools/qdoc/qdocdatabase.h index 2a91693c02..d715b71e23 100644 --- a/src/tools/qdoc/qdocdatabase.h +++ b/src/tools/qdoc/qdocdatabase.h @@ -65,21 +65,23 @@ enum FindFlag { NonFunction = 0x4 }; -class QDocDatabase +struct TargetRec { + public: + enum Type { Unknown, Target, Keyword, Contents, Class, Function, Page, Subtitle }; + TargetRec() : node_(0), priority_(INT_MAX), type_(Unknown) { } + bool isEmpty() const { return ref_.isEmpty(); } + //void debug(int idx, const QString& key); + Node* node_; + QString ref_; + int priority_; + Type type_; +}; +typedef QMultiMap<QString, TargetRec> TargetRecMultiMap; - struct Target - { - 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 QMultiMap<QString, Target> TargetMultiMap; +class QDocDatabase +{ public: static QDocDatabase* qdocDB(); static void destroyQdocDB(); @@ -127,7 +129,7 @@ class QDocDatabase const Node* resolveTarget(const QString& target, const Node* relative, const Node* self=0); const Node* findNodeForTarget(const QString& target, const Node* relative); - void insertTarget(const QString& name, Node* node, int priority); + void insertTarget(const QString& name, TargetRec::Type type, Node* node, int priority); /* convenience functions Many of these will be either eliminated or replaced. @@ -226,7 +228,7 @@ class QDocDatabase NodeMapMap funcIndex_; TextToNodeMap legaleseTexts_; DocNodeMultiMap docNodesByTitle_; - TargetMultiMap targetMultiMap_; + TargetRecMultiMap targetRecMultiMap_; }; QT_END_NAMESPACE |