]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
libvaladoc: Fix valac warnings
authorFlorian Brosch <flo.brosch@gmail.com>
Wed, 1 Sep 2010 05:32:10 +0000 (07:32 +0200)
committerFlorian Brosch <flo.brosch@gmail.com>
Wed, 1 Sep 2010 17:32:14 +0000 (19:32 +0200)
src/libvaladoc/api/tree.vala
src/libvaladoc/documentation/documentationparser.vala
src/libvaladoc/documentation/wiki.vala
src/libvaladoc/html/basicdoclet.vala
src/libvaladoc/importer/valadocdocumentationimporter.vala
src/libvaladoc/moduleloader.vala

index 5d07446f7de4856240b893e44749e95c4edc8ba1..2bcb5a971671b73013714ba1a38cfd2ec74b843b 100644 (file)
@@ -396,10 +396,10 @@ public class Valadoc.Api.Tree {
        }
 
        private void process_wiki (DocumentationParser docparser) {
-               this.wikitree = new WikiPageTree(this.reporter, this.settings);
+               this.wikitree = new WikiPageTree(reporter, settings);
                var pkg = get_source_package ();
                if (pkg != null) {
-                       wikitree.create_tree (docparser, pkg);
+                       wikitree.create_tree (docparser, pkg, reporter);
                }
        }
 
index 82dd65891f10d5699bac42f41b1e9c28fea2c0b2..071c67924a470ff2a4355f5dd397bf7ef5288cb2 100644 (file)
@@ -1105,10 +1105,12 @@ public class Valadoc.DocumentationParser : Object, ResourceLocator {
                _wiki_parser.set_root_rule (page);
        }
 
+#if DEBUG
        private void dump_stack () {
                message ("Dumping stack");
                foreach (Object object in _stack) {
                        message ("%s", object.get_type ().name ());
                }
        }
+#endif
 }
index ed20fe04c1b368ca329616fa55365b223ff2e7fb..33f77adda772ad3cd04ae22900af3205d8fe79c4 100755 (executable)
@@ -62,13 +62,13 @@ public class Valadoc.WikiPage : Object, Documentation {
                this.path = path;
        }
 
-       public void read () throws GLib.FileError {
+       public void read (ErrorReporter reporter) {
                try {
                        string content;
                        FileUtils.get_contents (this.path, out content);
                        this.documentation_str = content;
                } catch (FileError err) {
-                       throw err;
+                       reporter.simple_error ("Unable to read file `%s': %s".printf (this.path, err.message));
                }
        }
 
@@ -107,36 +107,36 @@ public class Valadoc.WikiPageTree : Object {
                return null;
        }
 
-       private void create_tree_from_path (DocumentationParser docparser, Api.Package package, string path, string? nameoffset = null) throws GLib.FileError {
-               Dir dir = Dir.open (path);
-
-               for (string? curname = dir.read_name (); curname!=null ; curname = dir.read_name ()) {
-                       string filename = Path.build_filename (path, curname);
-                       if (curname.has_suffix (".valadoc") && FileUtils.test (filename, FileTest.IS_REGULAR)) {
-                               WikiPage wikipage = new WikiPage ((nameoffset!=null)? Path.build_filename (nameoffset, curname) : curname, filename, package);
-                               this.wikipages.add(wikipage);
-                               wikipage.read ();
-                       } else if (FileUtils.test (filename, FileTest.IS_DIR)) {
-                               this.create_tree_from_path (docparser, package, filename, (nameoffset!=null)? Path.build_filename (nameoffset, curname) : curname);
+       private void create_tree_from_path (DocumentationParser docparser, Api.Package package, ErrorReporter reporer, string path, string? nameoffset = null) {
+               try {
+                       Dir dir = Dir.open (path);
+
+                       for (string? curname = dir.read_name (); curname!=null ; curname = dir.read_name ()) {
+                               string filename = Path.build_filename (path, curname);
+                               if (curname.has_suffix (".valadoc") && FileUtils.test (filename, FileTest.IS_REGULAR)) {
+                                       WikiPage wikipage = new WikiPage ((nameoffset!=null)? Path.build_filename (nameoffset, curname) : curname, filename, package);
+                                       this.wikipages.add(wikipage);
+                                       wikipage.read (reporter);
+                               } else if (FileUtils.test (filename, FileTest.IS_DIR)) {
+                                       this.create_tree_from_path (docparser, package, reporter, filename, (nameoffset!=null)? Path.build_filename (nameoffset, curname) : curname);
+                               }
                        }
+               } catch (FileError err) {
+                       reporter.simple_error ("Unable to open directory `%s': %s".printf (path, err.message));
                }
        }
 
-       public void create_tree (DocumentationParser docparser, Api.Package package) throws GLib.FileError {
-               try {
-                       weak string path = this.settings.wiki_directory;
-                       if (path == null) {
-                               return ;
-                       }
+       public void create_tree (DocumentationParser docparser, Api.Package package, ErrorReporter reporer) {
+               weak string path = this.settings.wiki_directory;
+               if (path == null) {
+                       return;
+               }
 
-                       this.wikipages = new ArrayList<WikiPage> ();
-                       this.create_tree_from_path (docparser, package, path);
+               this.wikipages = new ArrayList<WikiPage> ();
+               this.create_tree_from_path (docparser, package, reporter, path);
 
-                       foreach (WikiPage page in this.wikipages) {
-                               page.parse (docparser, package);
-                       }
-               } catch (FileError err) {
-                       throw err;
+               foreach (WikiPage page in this.wikipages) {
+                       page.parse (docparser, package);
                }
        }
 }
index f9fc82a4d080607c2375a78f6a85f88be6ed2ebf..a88703529de2e31f8a6ddefaf560648f170209c6 100755 (executable)
@@ -512,7 +512,6 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
        }
 
        public void write_symbol_content (Api.Node node) {
-               string full_name = node.get_full_name ();
                writer.start_tag ("div", {"class", css_style_content});
                writer.start_tag ("h1", {"class", css_title}).text (node.name).end_tag ("h1");
                writer.simple_tag ("hr", {"class", css_headline_hr});
index e895c941e74202520af4f0495b41d6902a21dd3e..7c6b23710dabfe771d8d0ae7693f9ce96e9f8071 100644 (file)
@@ -134,10 +134,6 @@ public class Valadoc.Importer.ValadocDocumentationImporter : DocumentationImport
                } catch (ParserError err) {
                }
        }
-
-       public string resolve (string path) {
-               return path;
-       }
 }
 
 
index 20519488298c87b8fca2d85c506a99c64df16bce..8743aecb0dd61a1523ac02ad5ef08819744b806f 100755 (executable)
@@ -35,6 +35,10 @@ public class Valadoc.ModuleLoader : TypeModule {
        private Module docletmodule;
        private Type doclettype;
 
+       public ModuleLoader () {
+               Object ();
+       }
+
        public override bool load () {
                return true;
        }