src/Project/Project.vala
[app.Builder.js] / src / Project / Gtk.vala
index 910366b..abebe8b 100644 (file)
@@ -115,11 +115,14 @@ namespace Project {
                        var basename = this.firstPath();
                        // eg. base = /home/xxx/fred/blogs
                        // target = /home/xxx/fred/jones
+                       
+                       // this does not work correctly...
                        var bb = basename;
                        var prefix = "";
                        while (true) {
                                if (    bb.length < target.length &&
                                        target.substring(0, bb.length) == bb) {
+                                       
                                        return prefix + target.substring(bb.length +1);
                                }
                                if (bb.length < 1) {
@@ -155,7 +158,7 @@ namespace Project {
           
                        try {
                                var file_enum = dir.enumerate_children(
-                                       GLib.FileAttribute.STANDARD_DISPLAY_NAME, 
+                                               GLib.FileAttribute.STANDARD_DISPLAY_NAME, 
                                        GLib.FileQueryInfoFlags.NONE, 
                                        null
                                );
@@ -171,8 +174,9 @@ namespace Project {
                                                continue;
                                        }
                                        
-                                       
-                                       
+                                       if (Regex.match_simple("\\.vala\\.c$", fn)) {
+                                               continue;
+                                       }
                                        if (Regex.match_simple("\\.c$", fn)) {
                                                
                                                // if we have a vala file with the same name 
@@ -215,6 +219,7 @@ namespace Project {
                        {
                                ret += "/";
                        }
+                       //print("combined path = %s",  ret + second);
                        return ret + second;
                }
                public   string  resolve_path_times(string part, int times, string? clue = null)
@@ -275,11 +280,10 @@ namespace Project {
                public string[] vapidirs()
                {
                        string[] ret = {};
-                       var sources = this.compilegroups.get("_default_").sources
+                       var sources = this.compilegroups.get("_default_").sources;
                        for(var i =0; i< sources.size; i++) {
                                
-                               var path = this.resolve_path(
-                               this.resolve_path_combine_path(this.firstPath(),sources.get(i)));
+                               var path = this.resolve_path( this.firstPath(), sources.get(i));
                                
                                if (Path.get_basename (path) == "vapi") {
                                        print("Adding VAPIDIR: %s\n", path);