]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix namespace resolution
authorDidier "Ptitjes <ptitjes@free.fr>
Tue, 20 Oct 2009 01:13:29 +0000 (03:13 +0200)
committerFlorian Brosch <flo.brosch@gmail.com>
Tue, 20 Oct 2009 01:13:29 +0000 (03:13 +0200)
src/doclets/htm/doclet/doclet.vala
src/doclets/htmlhelpers/doclet/doclet.vala
src/libvaladoc/api/package.vala
src/libvaladoc/api/tree.vala

index d6e252c9bb9069f8862582cda14777b7fceb3866..de41e1dae3b774504b772821aeeca3377d5100f2 100755 (executable)
@@ -148,7 +148,7 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
                writer = new MarkupWriter (file);
                _renderer.set_writer (writer);
                write_file_header (this.css_path, pkg_name);
-               write_navi_package (package, package);
+               write_navi_package (package);
                write_package_content (package, package);
                write_file_footer ();
                file = null;
index 097aa9d2618910b811bfc363b05f8cf7322218db..98f29cbb6875f700953cc57f2c08743865a1d1b0 100755 (executable)
@@ -50,8 +50,7 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
                if (full_name == true && element is Namespace) {
                        string tmp = element.full_name();
                        name = (tmp == null)? "Global Namespace" : tmp;
-               }
-               else {
+               } else {
                        string tmp = element.name;
                        name = (tmp == null)? "Global Namespace" : tmp;
                }
@@ -94,7 +93,6 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
        }
 
        protected void write_navi_top_entry (Api.Node element, Api.Node? parent) {
-               string name = (element.name == null)? "Global Namespace" : element.name;
                string style = get_html_css_class (element);
 
                writer.start_tag ("ul", css_navi);
@@ -144,35 +142,39 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
                }
        }
 
-       protected void write_navi_package (Package efile, Api.Node? pos) {
+       protected void write_navi_package (Package package) {
                Gee.ArrayList<Namespace> ns_list = new Gee.ArrayList<Namespace> ();
-               this.fetch_subnamespace_names (efile, ns_list);
-
+               this.fetch_subnamespace_names (package, ns_list);
 
                writer.start_tag ("div", css_style_navigation);
-
-
-               if (pos == null)
-                       this.write_top_elements (efile, null);
-               else if (pos == efile)
-                       this.write_top_elements (efile, efile);
-               else
-                       this.write_top_elements ((Api.Node)pos.parent.parent, pos);
-
+               write_top_elements (package, package);
                writer.start_tag ("ul", css_navi);
 
-
                Namespace globals = null;
 
                foreach (Namespace ns in ns_list) {
-                       if (ns.name == null)
+                       if (ns.name == null) {
                                globals = ns;
-                       else
-                               this.write_navi_entry (ns, pos, css_namespace, true, true);
+                       } else {
+                               this.write_navi_entry (ns, package, css_namespace, true, true);
+                       }
                }
 
                if (globals != null) {
-                       write_navi_children (globals, Api.NodeType.NAMESPACE, pos);
+                       write_navi_children (globals, Api.NodeType.ERROR_CODE, package);
+                       write_navi_children (globals, Api.NodeType.ENUM_VALUE, package);
+                       write_navi_children (globals, Api.NodeType.ENUM, package);
+                       write_navi_children (globals, Api.NodeType.INTERFACE, package);
+                       write_navi_children (globals, Api.NodeType.CLASS, package);
+                       write_navi_children (globals, Api.NodeType.STRUCT, package);
+                       write_navi_children (globals, Api.NodeType.CREATION_METHOD, package);
+                       write_navi_children (globals, Api.NodeType.STATIC_METHOD, package);
+                       write_navi_children (globals, Api.NodeType.CONSTANT, package);
+                       write_navi_children (globals, Api.NodeType.PROPERTY, package);
+                       write_navi_children (globals, Api.NodeType.DELEGATE, package);
+                       write_navi_children (globals, Api.NodeType.METHOD, package);
+                       write_navi_children (globals, Api.NodeType.SIGNAL, package);
+                       write_navi_children (globals, Api.NodeType.FIELD, package);
                }
 
                writer.end_tag ("ul");
index f86efab4d2601b3f9fca97c00360c08d93624cc7..dce75e5ca79da9abae14ef79b4a04041518801a3 100644 (file)
@@ -126,7 +126,7 @@ public class Valadoc.Api.Package : Node {
                        ns = (Namespace) get_namespace (root, parent_namespace_symbol);
                        if (ns != null) {
                                var new_namespace = new Namespace ((Vala.Namespace) namespace_symbol, ns);
-                               add_child (new_namespace);
+                               ns.add_child (new_namespace);
                                return new_namespace;
                        }
                }
index e80829e8f10bf25a525a8fd81c4ab893fd295641..c545a911e3db6d70642785cbffc170e2733e7019 100644 (file)
@@ -355,12 +355,6 @@ public class Valadoc.Api.Tree {
                        return null;
                }
 
-               if (params.size >= 2) {
-                       if (params.get(1) is Vala.Namespace) {
-                               params.remove_at (0);
-                       }
-               }
-
                Api.Node? node = package;
                foreach (Vala.Symbol a_symbol in params) {
                        node = node.find_by_symbol (a_symbol);