diff options
author | Martin Smith <martin.smith@digia.com> | 2015-05-27 14:24:26 +0200 |
---|---|---|
committer | Martin Smith <martin.smith@digia.com> | 2015-06-09 10:10:23 +0000 |
commit | 0ec550c748748fcc94008bc2555482bd614251dc (patch) | |
tree | e11b382d9331fb30b901108e1935d1e4bd03c1c1 /src/tools/qdoc/node.h | |
parent | d12b09edd867648f19764f097bcc7247404b823b (diff) |
qdoc: Always try to use the declaration location
qdoc now always tries to use an element's declaration location
for the "location," "filepath," and "lineno" attributes in the
index file, when it makes sense to use the declaration location.
That's pretty much everything in C++.
qdoc records both the declaration location and the definition
location in the element's tree node. When it writes the element
to the index file, it asks for the declaration location.
Change-Id: I2d169a0f028bb0d46717e6f822dacc6dd20673b2
Task-number: QTBUG-46034
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
Diffstat (limited to 'src/tools/qdoc/node.h')
-rw-r--r-- | src/tools/qdoc/node.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h index 845b99a4e8..8a666b1161 100644 --- a/src/tools/qdoc/node.h +++ b/src/tools/qdoc/node.h @@ -167,7 +167,7 @@ public: void setGenus(Genus t) { genus_ = (unsigned char) t; } void setAccess(Access t) { access_ = (unsigned char) t; } - void setLocation(const Location& location) { loc_ = location; } + void setLocation(const Location& t); void setDoc(const Doc& doc, bool replace = false); void setStatus(Status t) { if (status_ == (unsigned char) Obsolete && t == Deprecated) @@ -276,7 +276,9 @@ public: Access access() const { return (Access) access_; } bool isPrivate() const { return (Access) access_ == Private; } QString accessString() const; - const Location& location() const { return loc_; } + const Location& declLocation() const { return declLocation_; } + const Location& defLocation() const { return defLocation_; } + const Location& location() const { return (defLocation_.isEmpty() ? declLocation_ : defLocation_); } const Doc& doc() const { return doc_; } bool hasDoc() const { return !doc_.isEmpty(); } Status status() const { return (Status) status_; } @@ -345,7 +347,8 @@ private: Aggregate* parent_; Aggregate* relatesTo_; QString name_; - Location loc_; + Location declLocation_; + Location defLocation_; Doc doc_; QMap<LinkType, QPair<QString, QString> > linkMap_; QString fileNameBase_; |