From: Didier "Ptitjes Date: Tue, 20 Oct 2009 11:55:42 +0000 (+0200) Subject: Html: Sort members in the navigation X-Git-Tag: 0.37.1~3^2~539 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecd14716bfe348a0e8017e5eb1f06771be00877e;p=thirdparty%2Fvala.git Html: Sort members in the navigation --- diff --git a/src/doclets/htmlhelpers/doclet/Makefile.am b/src/doclets/htmlhelpers/doclet/Makefile.am old mode 100644 new mode 100755 diff --git a/src/doclets/htmlhelpers/doclet/doclet.vala b/src/doclets/htmlhelpers/doclet/doclet.vala index 83dc35cea..7c1519a30 100755 --- a/src/doclets/htmlhelpers/doclet/doclet.vala +++ b/src/doclets/htmlhelpers/doclet/doclet.vala @@ -216,7 +216,9 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet { } protected void write_navi_children (Api.Node node, Api.NodeType type, Api.Node? parent) { - foreach (Api.Node child in node.get_children_by_type (type)) { + var children = node.get_children_by_type (type); + children.sort (); + foreach (Api.Node child in children) { write_navi_entry (child, parent, get_html_css_class (child), child != parent); } } diff --git a/src/doclets/htmlhelpers/doclet/markupwriter.vala b/src/doclets/htmlhelpers/doclet/markupwriter.vala old mode 100644 new mode 100755 diff --git a/src/libvaladoc/api/node.vala b/src/libvaladoc/api/node.vala index 13466b7be..962c494f0 100644 --- a/src/libvaladoc/api/node.vala +++ b/src/libvaladoc/api/node.vala @@ -46,7 +46,7 @@ public enum Valadoc.Api.NodeType { TYPE_PARAMETER } -public abstract class Valadoc.Api.Node : Item, Visitable, Documentation { +public abstract class Valadoc.Api.Node : Item, Visitable, Documentation, Comparable { private bool do_document = false; public abstract string? name { owned get; } @@ -134,7 +134,7 @@ public abstract class Valadoc.Api.Node : Item, Visitable, Documentation { } } - return children.read_only_view; + return children; } public void accept_children_by_type (NodeType type, Visitor visitor) { @@ -233,5 +233,9 @@ public abstract class Valadoc.Api.Node : Item, Visitable, Documentation { } return this._full_name; } + + public int compare_to (Node node) { + return strcmp (name, node.name); + } } diff --git a/src/libvaladoc/api/tree.vala b/src/libvaladoc/api/tree.vala index c545a911e..868f11034 100644 --- a/src/libvaladoc/api/tree.vala +++ b/src/libvaladoc/api/tree.vala @@ -114,7 +114,7 @@ public class Valadoc.Api.Tree { this.context.checking = settings.enable_checking; this.context.deprecated = settings.deprecated; this.context.experimental = settings.experimental; - this.context.non_null_experimental = settings.non_null_experimental; +// this.context.non_null_experimental = settings.non_null_experimental; this.context.dbus_transformation = !settings.disable_dbus_transformation; @@ -292,14 +292,14 @@ public class Valadoc.Api.Tree { return false; } - if (context.non_null_experimental) { - Vala.NullChecker null_checker = new Vala.NullChecker (); - null_checker.check (this.context); +// if (context.non_null_experimental) { +// Vala.NullChecker null_checker = new Vala.NullChecker (); +// null_checker.check (this.context); - if (this.context.report.get_errors () > 0) { - return false; - } - } +// if (this.context.report.get_errors () > 0) { +// return false; +// } +// } Api.NodeBuilder builder = new NodeBuilder (this); this.context.accept(builder);