src/Project/Gtk.vala
[app.Builder.js] / src / Project / Gtk.vala
index cf250fc..d4381fd 100644 (file)
@@ -33,7 +33,11 @@ namespace Project {
                        this.xtype = "Gtk";
                        var gid = "project-gtk-%d".printf(gtk_id++);
                        this.id = gid;
-                       this.loadConfig();
+                       try {
+                               this.loadConfig();
+                       } catch (GLib.Error) {
+                               // is tihs ok?
+                       }
                
                }
                public Gee.HashMap<string,GtkValaSettings> compilegroups;
@@ -163,7 +167,7 @@ namespace Project {
                 *  
                 */
                
-               public Gee.ArrayList<string> filesAll(string in_path)
+               public Gee.ArrayList<string> filesAll(string in_path,bool abspath = true)
                {
                        var ret =  new Gee.ArrayList<string>();
                        
@@ -179,7 +183,7 @@ namespace Project {
                                GLib.debug("SCAN %s - skip - does not exist\n", dirname);
                                return ret;
                        }
-         
+                       var pathprefix = abspath ? dirname : in_path;
           
                        try {
                                var file_enum = dir.enumerate_children(
@@ -202,7 +206,7 @@ namespace Project {
                                                continue;
                                        }
                                        GLib.debug("SCAN ADD %s : %s", fn, next_file.get_content_type());
-                                       ret.add(in_path + "/" + fn);
+                                       ret.add(pathprefix + "/" + fn);
                                         
                                        // any other valid types???
                                
@@ -215,9 +219,9 @@ namespace Project {
                        return ret;
                }
                
-               public Gee.ArrayList<string> filesForCompile(string in_path)
+               public Gee.ArrayList<string> filesForCompile(string in_path, bool abspath = true)
                {
-                       var allfiles = this.filesAll(in_path);
+                       var allfiles = this.filesAll(in_path,abspath);
                        var ret =  new Gee.ArrayList<string>();
                        
                        
@@ -292,7 +296,7 @@ namespace Project {
                                                GLib.debug("SKIP %s - .o",fn);
                                                continue;
                                        }
-                                       if ("stamp-h1" == bn)) {
+                                       if ("stamp-h1" == bn) {
                                                GLib.debug("SKIP %s - .o",fn);
                                                continue;
                                        }
@@ -310,7 +314,7 @@ namespace Project {
                                                }
                                        }
                                        
-                                       if (Regex.match_simple("^\\.", GLib.Path.get_basename(fn))) {
+                                       if (Regex.match_simple("^\\.", bn)) {
                                                GLib.debug("SKIP %s - hidden",fn);
                                                continue;
                                        }