]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
doclets/gtkdoc: Hide ‘_construct’ functions from gtk-doc documentation
authorPhilip Withnall <philip@tecnocode.co.uk>
Thu, 16 Aug 2012 18:50:12 +0000 (20:50 +0200)
committerFlorian Brosch <flo.brosch@gmail.com>
Thu, 16 Aug 2012 18:50:12 +0000 (20:50 +0200)
The main ‘my_class_construct’ C function is hidden already,
but secondary ‘_construct’ functions for named constructors
are not. This fixes that, adding the ‘_construct’ functions
to gtk-doc’s ‘private’ symbol section.

src/doclets/gtkdoc/generator.vala

index af293912b3e643fc1f2c3b7b285eb2af40f7ab0a..de73195f315be66272ace446272244c7b58931f6 100644 (file)
@@ -808,6 +808,12 @@ It is important that your <link linkend=\"GValue\"><type>GValue</type></link> ho
                        see_also += get_docbook_link (m);
                        finish_gcomment.see_also = see_also;
                }
+
+               if (m.is_constructor && !m.get_cname ().has_suffix ("_new")) {
+                       // Hide secondary _construct methods from the documentation (the primary _construct method is hidden in visit_class())
+                       var file_data = get_file_data (m.get_filename ());
+                       file_data.private_section_lines.add (m.get_cname ().replace ("_new", "_construct"));
+               }
        }
 
        /**