[valadoc] Api: Take accessibility in account for property accessors



commit 506641b1b6ce3f966203b84cba2c5021f7c605b1
Author: Didier "Ptitjes <ptitjes free fr>
Date:   Tue Oct 20 14:24:49 2009 +0200

    Api: Take accessibility in account for property accessors

 src/libvaladoc/api/node.vala     |    2 +-
 src/libvaladoc/api/property.vala |   16 ++++++++++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/src/libvaladoc/api/node.vala b/src/libvaladoc/api/node.vala
index 962c494..f254535 100644
--- a/src/libvaladoc/api/node.vala
+++ b/src/libvaladoc/api/node.vala
@@ -47,7 +47,7 @@ public enum Valadoc.Api.NodeType {
 }
 
 public abstract class Valadoc.Api.Node : Item, Visitable, Documentation, Comparable<Node> {
-	private bool do_document = false;
+	protected bool do_document { private set; get; default = false; }
 
 	public abstract string? name { owned get; }
 
diff --git a/src/libvaladoc/api/property.vala b/src/libvaladoc/api/property.vala
index ffd149c..ca3ef6b 100644
--- a/src/libvaladoc/api/property.vala
+++ b/src/libvaladoc/api/property.vala
@@ -84,6 +84,18 @@ public class Valadoc.Api.Property : Member {
 		property_type.resolve_type_references (root);
 	}
 
+	protected override void process_comments (Settings settings, DocumentationParser parser) {
+		if (getter != null && getter.is_visitor_accessible (settings)) {
+			getter.process_comments (settings, parser);
+		}
+
+		if (setter != null && setter.is_visitor_accessible (settings)) {
+			setter.process_comments (settings, parser);
+		}
+
+		base.process_comments (settings, parser);
+	}
+
 	protected override Inline build_signature () {
 		var signature = new SignatureBuilder ();
 
@@ -100,11 +112,11 @@ public class Valadoc.Api.Property : Member {
 		signature.append_symbol (this);
 		signature.append ("{");
 
-		if (setter != null) {
+		if (setter != null && setter.do_document) {
 			signature.append_content (setter.signature);
 		}
 
-		if (getter != null) {
+		if (getter != null && getter.do_document) {
 			signature.append_content (getter.signature);
 		}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]