src/Project/Gtk.vala
[app.Builder.js] / src / Project / Gtk.vala
index 183f048..c20314d 100644 (file)
@@ -134,16 +134,21 @@ namespace Project {
                }
                 
                
-               public Gee.ArrayList<string> files(string in_path, Gee.ArrayList<string> ret)
+               public Gee.ArrayList<string> files(string in_path)
                {
+                       var ret =  new Gee.ArrayList<string>();
+                       var cfiles =  new Gee.ArrayList<string>();
                        
                        var dirname = this.resolve_path(
                                this.resolve_path_combine_path(this.firstPath(),in_path));
+                       
+                       print("SCAN %s\n", dirname);
                                // scan the directory for files -- ending with vala || c
                        
 
                        var dir = File.new_for_path(dirname);
                        if (!dir.query_exists()) {
+                               print("SCAN %s - skip - does not exist\n", dirname);
                                return ret;
                        }
          
@@ -159,8 +164,10 @@ namespace Project {
                                FileInfo next_file; 
                                while ((next_file = file_enum.next_file(null)) != null) {
                                        var fn = next_file.get_display_name();
+                                       
+                                       print("SCAN %s - checking %s\n", dirname, fn);
                                        if (Regex.match_simple("\\.vala$", fn)) {
-                                               ret.add(dirname + "/" + fn);
+                                               ret.add(in_path + "/" + fn);
                                                continue;
                                        }
                                        
@@ -173,11 +180,11 @@ namespace Project {
                                                var vv = (new Regex("\\.c$")).replace(
                                                        fn, fn.length, 0, ".vala");
                                                        
-                                               if (ret.index_of(vv) > -1) {
+                                               if (ret.index_of(in_path + "/" + vv) > -1) {
                                                        continue;
                                                }
                                                
-                                               ret.add(dirname + "/" + fn);
+                                               cfiles.add(in_path + "/" + fn);
                                                continue;
                                        }
                                        // any other valid types???
@@ -186,7 +193,7 @@ namespace Project {
                        } catch(Error e) {
                                print("oops - something went wrong scanning the projects\n");
                        }
-
+                       print("SCAN %s = returning %d", dirname, ret.size);
                         
                        return ret;