Fix #8048 - context provider start work - fix meson build flag - project settings...
[roobuilder] / src / Project / Project.vala
index c16f226..6f03ac3 100644 (file)
@@ -68,8 +68,8 @@ namespace Project {
                        }
                         
                }
-                               
-               
+               public string version = "1.0";
+               public string licence = "LGPL";         
                public string path = "";
                private Gee.ArrayList<JsRender.JsRender> sub_paths;
                
@@ -85,7 +85,7 @@ namespace Project {
                public  Gee.HashMap<string,Palete.GirObject> gir_cache = null; // used by Gir ??? is this used by Roo?
                //public Palete.ValaCompileRequest last_request = null; // depricated?
                public Gee.HashMap<string,GLib.ListStore>? errorsByType = null;
+               public bool loading = false; // flag this to block saving (normally when loading ui that might trigger save..
                
                
                protected Gee.HashMap<string,Palete.LanguageClient> language_servers;
@@ -416,7 +416,11 @@ namespace Project {
 
                public void save()
                {
-                         
+                       
+                       if (this.loading) {
+                               return;
+                       }
+                       
                        var  s =  this.toJSON();
                        GLib.debug("Save Project %s\n%s", this.name, s);
                        try {
@@ -692,6 +696,12 @@ namespace Project {
                        if (subdir == "build") { // cmake!
                                return;
                        }
+                       if (subdir == "build-dir") { // flatpack
+                               return;
+                       }
+                       if (subdir == "repo") { // flatpack ?? wrong command?
+                               return;
+                       }
                        if (subdir == "autom4te.cache") { // automake?
                                return;
                        }
@@ -979,9 +989,6 @@ namespace Project {
                        string[] ret = {};
                         
                        foreach(var jdir in this.sub_paths) { 
-                               
-
-                               
                                if (Path.get_basename (jdir.path) == name) {
                                        GLib.debug("pathsMatching %s\n", jdir.path);
                                        ret += full_path ? jdir.path : jdir.relpath;
@@ -991,6 +998,21 @@ namespace Project {
                        return ret;
                        
                }
+               
+               public Gee.ArrayList<JsRender.Dir> pathsUnder(string name)
+               {
+                       var ret = new Gee.ArrayList<JsRender.Dir>();
+                        
+                       foreach(var jdir in this.sub_paths) { 
+                               if (jdir.relpath.has_prefix(name + "/")) {
+                                       ret.add(jdir as JsRender.Dir);
+                               }
+                               
+                       }
+                       return ret;
+                       
+               }
+               
                public Gee.ArrayList<string> readArray(Json.Array ar) 
                {
                        var ret = new Gee.ArrayList<string>();