Builder4/ValaProjectSettings.bjs
authorAlan Knowles <alan@roojs.com>
Wed, 19 Nov 2014 12:35:57 +0000 (20:35 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 19 Nov 2014 12:35:57 +0000 (20:35 +0800)
Builder4/ValaProjectSettings.vala

Builder4/ValaProjectSettings.bjs
Builder4/ValaProjectSettings.vala

index 255c8dc..f01e9fd 100644 (file)
                                         },
                                         {
                                             "listeners" : {
-                                                "changed" : "() => {\n    _this.project.get(_this.targets_tree.cursor).compile_flags = this.el.text;\n}"
+                                                "changed" : "() => {\n    if (_this.targets_tree.cursor.length < 1) {\n        return;\n    }\n    _this.project.compilegroups.get(_this.targets_tree.cursor).compile_flags = this.el.text;\n}"
                                             },
                                             "id" : "build_compile_flags",
                                             "xtype" : "Entry",
index 5bc9698..fca1a87 100644 (file)
@@ -1391,7 +1391,10 @@ public class ValaProjectSettings : Object
 
             // listeners 
             this.el.changed.connect( () => {
-                _this.project.get(_this.targets_tree.cursor).compile_flags = this.el.text;
+                if (_this.targets_tree.cursor.length < 1) {
+                    return;
+                }
+                _this.project.compilegroups.get(_this.targets_tree.cursor).compile_flags = this.el.text;
             });
         }