diff options
author | Martin Smith <martin.smith@digia.com> | 2014-11-25 15:18:49 +0100 |
---|---|---|
committer | Martin Smith <martin.smith@digia.com> | 2015-01-12 13:12:05 +0100 |
commit | df6d2290e6399471431811160a0c0ff2eb16cb62 (patch) | |
tree | 4465dc3480b596391da7a0e13dc496d3ca0058ee /src/tools/qdoc/atom.h | |
parent | 9da1a1286493846fb0d58f7a848c13653136e1b3 (diff) |
qdoc: qdoc's 'square bracket' parameters were evaluated too early
qdoc's link command (\l) allows an optional first argument enclosed in
square brackets. This argument is used for narrowing and focusing the
search for the link target. The argument should not be evaluated until
the generate phase, but it was being evaluated in the prepare
phase. This was also a problem when running qdoc in the single-exec
mode. This update prevents qdoc from evaluating the argument until it
is used in the generate phase.
Change-Id: I82785e97077053fb5f5c11f0592155675334aaeb
Task-number: QTBUG-42880
Reviewed-by: Martin Smith <martin.smith@digia.com>
Diffstat (limited to 'src/tools/qdoc/atom.h')
-rw-r--r-- | src/tools/qdoc/atom.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/tools/qdoc/atom.h b/src/tools/qdoc/atom.h index 859ea3e740..9d453517dd 100644 --- a/src/tools/qdoc/atom.h +++ b/src/tools/qdoc/atom.h @@ -194,11 +194,12 @@ public: const QStringList& strings() const { return strs; } virtual bool isLinkAtom() const { return false; } - virtual Node::Genus genus() const { return Node::DontCare; } - virtual bool specifiesDomain() const { return false; } - virtual Tree* domain() const { return 0; } - virtual Node::Type goal() const { return Node::NoType; } + virtual Node::Genus genus() { return Node::DontCare; } + virtual bool specifiesDomain() { return false; } + virtual Tree* domain() { return 0; } + virtual Node::Type goal() { return Node::NoType; } virtual const QString& error() { return noError_; } + virtual void resolveSquareBracketParams() { } protected: static QString noError_; @@ -216,17 +217,20 @@ class LinkAtom : public Atom virtual ~LinkAtom() { } virtual bool isLinkAtom() const Q_DECL_OVERRIDE { return true; } - virtual Node::Genus genus() const Q_DECL_OVERRIDE { return genus_; } - virtual bool specifiesDomain() const Q_DECL_OVERRIDE { return (domain_ != 0); } - virtual Tree* domain() const Q_DECL_OVERRIDE { return domain_; } - virtual Node::Type goal() const Q_DECL_OVERRIDE { return goal_; } + virtual Node::Genus genus() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return genus_; } + virtual bool specifiesDomain() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return (domain_ != 0); } + virtual Tree* domain() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return domain_; } + virtual Node::Type goal() Q_DECL_OVERRIDE { resolveSquareBracketParams(); return goal_; } virtual const QString& error() Q_DECL_OVERRIDE { return error_; } + virtual void resolveSquareBracketParams() Q_DECL_OVERRIDE; protected: + bool resolved_; Node::Genus genus_; Node::Type goal_; Tree* domain_; QString error_; + QString squareBracketParams_; }; #define ATOM_FORMATTING_BOLD "bold" |