]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
devhelp-doclet: _renderer: null pointer fix
authorFlorian Brosch <flo.brosch@gmail.com>
Wed, 21 Oct 2009 10:41:33 +0000 (12:41 +0200)
committerFlorian Brosch <flo.brosch@gmail.com>
Wed, 21 Oct 2009 10:41:33 +0000 (12:41 +0200)
src/doclets/devhelp/doclet/doclet.vala
src/doclets/htm/doclet/doclet.vala
src/doclets/htmlhelpers/doclet/doclet.vala

index 39e5ccab92feeb5fd32295253e119f8c6c87aeca..28c2b605255ce18f3e8febb6a448221b8404c1c3 100755 (executable)
@@ -204,23 +204,27 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
        private DevhelpFormat devhelp;
        private Api.Tree tree;
 
-       private string get_path ( Api.Node element ) {
+       construct {
+               _renderer = new HtmlRenderer (this);
+       }
+
+       private string get_path (Api.Node element) {
                return element.full_name () + ".html";
        }
 
-       private string get_real_path ( Api.Node element ) {
-               return GLib.Path.build_filename ( this.settings.path, this.package_dir_name, element.full_name () + ".html" );
+       private string get_real_path (Api.Node element) {
+               return GLib.Path.build_filename (this.settings.path, this.package_dir_name, element.full_name () + ".html");
        }
 
        public override void process (Settings settings, Api.Tree tree) {
                this.settings = settings;
                this.tree = tree;
 
-               DirUtils.create ( this.settings.path, 0777 );
+               DirUtils.create (this.settings.path, 0777);
 
-               this.devhelp = new DevhelpFormat ( settings.pkg_name, "" );
+               this.devhelp = new DevhelpFormat (settings.pkg_name, "");
 
-               write_wiki_pages ( tree, css_path_wiki, Path.build_filename(this.settings.path, this.settings.pkg_name, "content") );
+               write_wiki_pages (tree, css_path_wiki, Path.build_filename (this.settings.path, this.settings.pkg_name, "content"));
 
                tree.accept (this);
        }
@@ -232,25 +236,25 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
        public override void visit_package (Package package) {
                string pkg_name = package.name;
 
-               string path = GLib.Path.build_filename ( this.settings.path, pkg_name );
-               string filepath = GLib.Path.build_filename ( path, "index.htm" );
-               string imgpath = GLib.Path.build_filename ( path, "img" );
-               string devpath = GLib.Path.build_filename ( path, pkg_name + ".devhelp2" );
+               string path = GLib.Path.build_filename (this.settings.path, pkg_name);
+               string filepath = GLib.Path.build_filename (path, "index.htm");
+               string imgpath = GLib.Path.build_filename (path, "img");
+               string devpath = GLib.Path.build_filename (path, pkg_name + ".devhelp2");
 
                WikiPage wikipage = null;
-               if ( this.settings.pkg_name == package.name && this.tree.wikitree != null ) {
+               if (this.settings.pkg_name == package.name && this.tree.wikitree != null) {
                        wikipage = this.tree.wikitree.search ("index.valadoc");
                }
 
                this.package_dir_name = pkg_name;
 
-               var rt = DirUtils.create ( path, 0777 );
-               rt = DirUtils.create ( imgpath, 0777 );
-               copy_directory ( Config.doclet_path + "deps/", path );
+               var rt = DirUtils.create (path, 0777);
+               rt = DirUtils.create (imgpath, 0777);
+               copy_directory (Config.doclet_path + "deps/", path);
 
-               this.devhelp = new DevhelpFormat ( pkg_name, "" );
+               this.devhelp = new DevhelpFormat (pkg_name, "");
 
-               GLib.FileStream file = GLib.FileStream.open ( filepath, "w" );
+               GLib.FileStream file = GLib.FileStream.open (filepath, "w");
                writer = new MarkupWriter (file);
                writer.xml_declaration ();
                _renderer.set_writer (writer);
@@ -261,7 +265,7 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
 
                package.accept_all_children (this);
 
-               this.devhelp.save_file ( devpath );
+               this.devhelp.save_file (devpath);
        }
 
        private void process_compound_node (Api.Node node, KeywordType type) {
@@ -275,7 +279,7 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
                        writer = new MarkupWriter (file);
                        writer.xml_declaration ();
                        _renderer.set_writer (writer);
-                       write_file_header (css_path, node.full_name());
+                       write_file_header (css_path, node.full_name ());
                        write_symbol_content (node);
                        write_file_footer ();
                        file = null;
@@ -364,8 +368,8 @@ public class Valadoc.Devhelp.Doclet : Valadoc.Html.BasicDoclet {
 }
 
 [ModuleInit]
-public Type register_plugin ( ) {
+public Type register_plugin () {
        Valadoc.Html.get_html_link_imp = Valadoc.Devhelp.get_html_link;
-       return typeof ( Valadoc.Devhelp.Doclet );
+       return typeof (Valadoc.Devhelp.Doclet);
 }
 
index 266c1dead98ba0ac70bdc35b3c80ef5522da8e96..41df8c4bcc00590b054ad1c8dd2e2c89159c6cdd 100755 (executable)
@@ -116,12 +116,12 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
        public override void process (Settings settings, Api.Tree tree) {
                this.settings = settings;
 
-               DirUtils.create ( this.settings.path, 0777 );
-               copy_directory ( GLib.Path.build_filename ( Config.doclet_path, "deps" ), settings.path );
+               DirUtils.create (this.settings.path, 0777);
+               copy_directory (GLib.Path.build_filename ( Config.doclet_path, "deps"), settings.path);
 
-               write_wiki_pages ( tree, css_path_wiki, Path.build_filename(settings.path, "content") );
+               write_wiki_pages (tree, css_path_wiki, Path.build_filename(settings.path, "content"));
 
-               GLib.FileStream file = GLib.FileStream.open ( GLib.Path.build_filename ( settings.path, "index.html" ), "w" );
+               GLib.FileStream file = GLib.FileStream.open (GLib.Path.build_filename ( settings.path, "index.html" ), "w");
                writer = new MarkupWriter (file);
                writer.xml_declaration ();
                _renderer.set_writer (writer);
@@ -142,10 +142,10 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
                string pkg_name = package.name;
                string path = GLib.Path.build_filename ( this.settings.path, pkg_name );
 
-               var rt = DirUtils.create ( path, 0777 );
-               rt = DirUtils.create ( GLib.Path.build_filename ( path, "img" ), 0777 );
+               var rt = DirUtils.create (path, 0777);
+               rt = DirUtils.create (GLib.Path.build_filename ( path, "img" ), 0777);
 
-               GLib.FileStream file = GLib.FileStream.open ( GLib.Path.build_filename ( path, "index.htm" ), "w" );
+               GLib.FileStream file = GLib.FileStream.open (GLib.Path.build_filename ( path, "index.htm" ), "w");
                writer = new MarkupWriter (file);
                writer.xml_declaration ();
                _renderer.set_writer (writer);
@@ -158,15 +158,15 @@ public class Valadoc.HtmlDoclet : Valadoc.Html.BasicDoclet {
                package.accept_all_children (this);
        }
 
-       public override void visit_namespace ( Namespace ns ) {
-               string rpath = this.get_real_path ( ns );
+       public override void visit_namespace (Namespace ns) {
+               string rpath = this.get_real_path (ns);
 
-               if ( ns.name != null ) {
-                       GLib.FileStream file = GLib.FileStream.open ( rpath, "w" );
+               if (ns.name != null) {
+                       GLib.FileStream file = GLib.FileStream.open (rpath, "w");
                        writer = new MarkupWriter (file);
                        writer.xml_declaration ();
                        _renderer.set_writer (writer);
-                       write_file_header (this.css_path, ns.full_name());
+                       write_file_header (this.css_path, ns.full_name ());
                        write_navi_symbol (ns);
                        write_namespace_content (ns, ns);
                        write_file_footer ();
index cb3799e542f64bb4fe89c7aac47f5bcc7b6f5672..262b68b09d113fc8e064d5d3c2d1c15d2e369676 100755 (executable)
@@ -221,7 +221,7 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
 
        protected void write_navi_children (Api.Node node, Api.NodeType type, Api.Node? parent) {
                var children = node.get_children_by_type (type);
-               //children.sort ();
+               //children.sort (); // ref counter err
                foreach (Api.Node child in children) {
                        write_navi_entry (child, parent, get_html_css_class (child), child != parent);
                }