]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
doclets/gtkdoclet: Fix handling undocumented parameters. Support not-error.
authorLuca Bruno <lethalman88@gmail.com>
Tue, 4 May 2010 20:06:06 +0000 (22:06 +0200)
committerFlorian Brosch <flo.brosch@gmail.com>
Tue, 4 May 2010 20:06:06 +0000 (22:06 +0200)
src/doclets/gtkdoc/generator.vala

index c0766e53c3b53d191d79df14780899ab31f434f8..142d6f9fa35e8fdf5af9dffb412e04ae2bb05674 100644 (file)
@@ -123,7 +123,7 @@ public class Gtkdoc.Generator : Api.Visitor {
                                }
                        }
 
-                       if (!found) {
+                       if (!found && lang_header.value != null) {
                                headers.add (lang_header);
                        }
                }
@@ -192,7 +192,7 @@ public class Gtkdoc.Generator : Api.Visitor {
        }
 
        private Header? add_header (string name, Comment? comment, string[]? annotations = null) {
-               if (comment == null) {
+               if (comment == null && annotations == null) {
                        return null;
                }
 
@@ -454,7 +454,6 @@ public class Gtkdoc.Generator : Api.Visitor {
                } else if (param.is_ref) {
                        direction = "inout";
                }
-
                annotations += direction;
 
                if (param.parameter_type.is_nullable) {
@@ -469,13 +468,15 @@ public class Gtkdoc.Generator : Api.Visitor {
                        annotations += "array length=%s".printf (param.name+"_length1");
                }
 
-               if (param.documentation != null) {
-                       add_header (param.name, param.documentation, annotations);
+               if (get_cname (param.parameter_type.data_type) == "GError") {
+                       annotations += "not-error";
                }
-               else if (current_signal != null && param.documentation == null) {
+
+               if (current_signal != null && param.documentation == null) {
                        // gtkdoc writes arg0, arg1 which is ugly. As a workaround, we always add an header for them.
                        add_manual_header (param.name, "", null);
-                       return;
+               } else {
+                       add_header (param.name, param.documentation, annotations);
                }
                param.accept_all_children (this);
        }