[valadoc] libvaladoc/api: adds GLib.Error to exception lists



commit b2bd418d8a826be521475fd08855f6eb2116f45f
Author: Florian Brosch <flo brosch gmail com>
Date:   Tue Aug 3 03:27:26 2010 +0200

    libvaladoc/api: adds GLib.Error to exception lists

 src/libvaladoc/api/delegate.vala     |    2 +-
 src/libvaladoc/api/method.vala       |    2 +-
 src/libvaladoc/api/node.vala         |   10 ++++++++++
 src/libvaladoc/html/basicdoclet.vala |    2 +-
 4 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/src/libvaladoc/api/delegate.vala b/src/libvaladoc/api/delegate.vala
index 4f79806..8f074fe 100644
--- a/src/libvaladoc/api/delegate.vala
+++ b/src/libvaladoc/api/delegate.vala
@@ -91,7 +91,7 @@ public class Valadoc.Api.Delegate : TypeSymbol {
 
 		signature.append (")", false);
 
-		var exceptions = get_children_by_type (NodeType.ERROR_DOMAIN);
+		var exceptions = get_children_by_types ({NodeType.ERROR_DOMAIN, NodeType.CLASS});
 		if (exceptions.size > 0) {
 			signature.append_keyword ("throws");
 			first = true;
diff --git a/src/libvaladoc/api/method.vala b/src/libvaladoc/api/method.vala
index a362f4a..9b114a4 100644
--- a/src/libvaladoc/api/method.vala
+++ b/src/libvaladoc/api/method.vala
@@ -190,7 +190,7 @@ public class Valadoc.Api.Method : Member {
 
 		signature.append (")", false);
 
-		var exceptions = get_children_by_type (NodeType.ERROR_DOMAIN);
+		var exceptions = get_children_by_types ({NodeType.ERROR_DOMAIN, NodeType.CLASS});
 		if (exceptions.size > 0) {
 			signature.append_keyword ("throws");
 			first = true;
diff --git a/src/libvaladoc/api/node.vala b/src/libvaladoc/api/node.vala
index f936eea..90aedfb 100644
--- a/src/libvaladoc/api/node.vala
+++ b/src/libvaladoc/api/node.vala
@@ -166,6 +166,16 @@ public abstract class Valadoc.Api.Node : Item, Browsable, Documentation, Compara
 		return children;
 	}
 
+	public Gee.List<Node> get_children_by_types (NodeType[] types, bool filtered = true) {
+		var children = new ArrayList<Node> ();
+
+		foreach (NodeType type in types) {
+			children.add_all (get_children_by_type (type, filtered));
+		}
+
+		return children;
+	}
+
 	public void accept_children_by_type (NodeType type, Visitor visitor) {
 		Gee.List<Node> all_children = per_type_children.get (type);
 		if (all_children != null) {
diff --git a/src/libvaladoc/html/basicdoclet.vala b/src/libvaladoc/html/basicdoclet.vala
index 27dcf92..f9fc82a 100755
--- a/src/libvaladoc/html/basicdoclet.vala
+++ b/src/libvaladoc/html/basicdoclet.vala
@@ -539,7 +539,7 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
 			write_package_note (node);
 		}
 
-		if (!(node is Method || node is Delegate || node is Api.Signal)) { // avoids exception listings
+		if (!(node is Method || node is Delegate)) { // avoids exception listings
 			if (node.has_children ({
 					Api.NodeType.ERROR_CODE,
 					Api.NodeType.ENUM_VALUE,



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