From: Florian Brosch Date: Tue, 3 Aug 2010 01:27:26 +0000 (+0200) Subject: libvaladoc/api: adds GLib.Error to exception lists X-Git-Tag: 0.37.1~3^2~440 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2bd418d8a826be521475fd08855f6eb2116f45f;p=thirdparty%2Fvala.git libvaladoc/api: adds GLib.Error to exception lists --- diff --git a/src/libvaladoc/api/delegate.vala b/src/libvaladoc/api/delegate.vala index 4f79806da..8f074fe83 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 a362f4aec..9b114a4b2 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 f936eea5e..90aedfba4 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 get_children_by_types (NodeType[] types, bool filtered = true) { + var children = new ArrayList (); + + 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 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 27dcf927c..f9fc82a4d 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,