remove print debug code - replace with Glib debug
authorAlan <alan@roojs.com>
Fri, 22 Jul 2022 02:04:42 +0000 (10:04 +0800)
committerAlan <alan@roojs.com>
Fri, 22 Jul 2022 02:04:42 +0000 (10:04 +0800)
src/Builder4/ValaProjectSettingsPopover.bjs
src/Builder4/ValaProjectSettingsPopover.vala
src/Builder4/config1.builder

index 9049b4f..d20bc63 100644 (file)
                   "    this.el.clear();",
                   "    var pal = (Palete.Gtk) _this.project.palete;",
                   "    var pkgs = pal.packages(_this.project);",
-                  "    print(\"ValaProjectSettings:packages load %d\\n\", pkgs.size);",
+                  "    GLib.debug(\"ValaProjectSettings:packages load %d\\n\", pkgs.size);",
                   "",
                   "    Gtk.TreeIter citer;",
                   "",
                  "listeners" : {
                   "activate" : [
                    "()  => {",
-                   "    ",
-                   "     //",
-                   "        Gtk.TreeModel mod;",
-                   "        Gtk.TreeIter iter;",
-                   "        if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {",
-                   "               print(\"nothing selected\\n\");",
-                   "            return;",
-                   "        }",
                    "",
-                   "            ",
-                   "       // add the directory..",
-                   "       ",
-                   "       ",
-                   "       GLib.Value val;",
-                   "        mod.get_value(iter,0, out val);",
-                   "       var fn =  (string) val;",
-                   "       ",
-                   "       print(\"remove: %s\\n\", fn);",
-                   "       if (!_this.project.compilegroups.get(\"_default_\").sources.remove(fn)) {",
-                   "                  print(\"remove failed\");",
-                   "              }",
-                   "       _this.default_directory_tree_store.load();",
+                   "\t//",
+                   "\tGtk.TreeModel mod;",
+                   "\tGtk.TreeIter iter;",
+                   "\tif (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {",
+                   "\t\tGLib.debug(\"nothing selected\\n\");",
+                   "\t\treturn;",
+                   "\t}",
+                   "",
+                   "\t\t",
+                   "\t// add the directory..",
+                   "",
+                   "",
+                   "\tGLib.Value val;",
+                   "\tmod.get_value(iter,0, out val);",
+                   "\tvar fn =  (string) val;",
+                   "",
+                   "\tGLib.debug(\"remove: %s\\n\", fn);",
+                   "\tif (!_this.project.compilegroups.get(\"_default_\").sources.remove(fn)) {",
+                   "\t\tGLib.debug(\"remove failed\");",
+                   "\t}",
+                   "\t_this.default_directory_tree_store.load();",
                    "}"
                   ]
                  },
                 "activate" : [
                  "()  => {",
                  "    ",
-                 "     //",
-                 "        Gtk.TreeModel mod;",
-                 "        Gtk.TreeIter iter;",
-                 "        if (!_this.targets_tree.el.get_selection().get_selected(out mod, out iter)) {",
-                 "               print(\"nothing selected\\n\");",
-                 "            return;",
-                 "        }",
+                 "\t//",
+                 "\tGtk.TreeModel mod;",
+                 "\tGtk.TreeIter iter;",
+                 "\tif (!_this.targets_tree.el.get_selection().get_selected(out mod, out iter)) {",
+                 "\t\tGLib.debug(\"nothing selected\\n\");",
+                 "\t\treturn;",
+                 "\t}",
                  "",
-                 "            ",
-                 "       // add the directory..",
-                 "       ",
-                 "       ",
-                 "       GLib.Value val;",
-                 "        mod.get_value(iter,0, out val);",
-                 "       var fn =  (string) val;",
-                 "       ",
-                 "       print(\"remove: %s\\n\", fn);",
-                 "       if (!_this.project.compilegroups.unset(fn)) {",
-                 "                  print(\"remove failed\");",
-                 "      }",
-                 "       _this.targets_tree_store.load();",
+                 "",
+                 "\t// add the directory..",
+                 "",
+                 "",
+                 "\tGLib.Value val;",
+                 "\tmod.get_value(iter,0, out val);",
+                 "\tvar fn =  (string) val;",
+                 "",
+                 "\tGLib.debug(\"remove: %s\\n\", fn);",
+                 "\tif (!_this.project.compilegroups.unset(fn)) {",
+                 "\t\tGLib.debug(\"remove failed\");",
+                 "\t}",
+                 "\t_this.targets_tree_store.load();",
                  "}"
                 ]
                },
               "cursor_changed" : [
                " ( ) => {",
                "",
-               "    if (this.cursor != \"\") {",
-               "         // save the values..",
-               "     }",
-               "     ",
-               "     // load the new values.",
-               "     ",
+               "\tif (this.cursor != \"\") {",
+               "\t\t// save the values..",
+               "\t}",
+               "",
+               "\t// load the new values.",
+               "",
+               "",
+               "\tGtk.TreeModel mod;",
+               "\tGtk.TreeIter iter;",
+               "\tif (!this.el.get_selection().get_selected(out mod, out iter)) {",
+               "\t\tGLib.debug(\"nothing selected\\n\");",
+               "\t\t// should disable the right hand side..",
+               "\t\t_this.set_vbox.el.hide();",
+               "\t\treturn;",
+               "\t}",
+               "\t_this.set_vbox.el.show();",
+               "",
+               "\t// add the directory..",
+               "",
+               "",
+               "\tGLib.Value val;",
+               "\tmod.get_value(iter,0, out val);",
+               "\tvar fn =  (string) val;",
+               "",
+               "\tthis.cursor = fn;",
+               "\tvar cg = _this.project.compilegroups.get(fn);",
+               "",
+               "\t_this.build_pack_target.el.set_text(cg.target_bin);",
+               "\t_this.build_compile_flags.el.set_text(cg.compile_flags);",
+               "\t_this.build_execute_args.el.set_text(cg.execute_args);",
+               "",
+               "\t_this.set_vbox.cgroup = cg;",
+               "\t_this.files_tree_store.update();",
                "",
-               "         Gtk.TreeModel mod;",
-               "        Gtk.TreeIter iter;",
-               "        if (!this.el.get_selection().get_selected(out mod, out iter)) {",
-               "            print(\"nothing selected\\n\");",
-               "            // should disable the right hand side..",
-               "            _this.set_vbox.el.hide();",
-               "            return;",
-               "        }",
-               "        _this.set_vbox.el.show();",
-               "            ",
-               "       // add the directory..",
-               "       ",
-               "       ",
-               "       GLib.Value val;",
-               "        mod.get_value(iter,0, out val);",
-               "       var fn =  (string) val;",
-               "       ",
-               "       this.cursor = fn;",
-               "       var cg = _this.project.compilegroups.get(fn);",
-               "       ",
-               "       _this.build_pack_target.el.set_text(cg.target_bin);",
-               "       _this.build_compile_flags.el.set_text(cg.compile_flags);",
-               "\t\t_this.build_execute_args.el.set_text(cg.execute_args);",
-               "       ",
-               "       _this.set_vbox.cgroup = cg;",
-               "       _this.files_tree_store.update();",
-               "       ",
                "       // load the srouces",
                "",
                "",
                   "        this.el.set_value(citer, 1,   \"<span foreground=\\\"green\\\" font_weight=\\\"bold\\\">\" + ",
                   "                    GLib.Markup.escape_text(items.get(i)) + \"</span>\"",
                   "            ); // title ",
-                  "        print(\"ADD item %s\", items.get(i));",
+                  "        GLib.debug(\"ADD item %s\", items.get(i));",
                   "        this.el.set_value(citer, 2,   \"dir\"); // type         ",
                   "        this.el.set_value(citer, 3,   false ); // checked ",
                   "",
                   "        ",
                   "         for(var j =0 ; j < files.size; j++) {",
                   "            this.el.append(out citer);   ",
-                  "             print(\"ADD item %s\", files.get(j));",
+                  "             GLib.debug(\"ADD item %s\", files.get(j));",
                   "            this.el.set_value(citer, 0,   files.get(j) ); // title ",
                   "            this.el.set_value(citer, 1,   GLib.Markup.escape_text( Path.get_basename (files.get(j))) ); // title             ",
                   "            this.el.set_value(citer, 2,   \"file\"); // type         ",
index ed8bfd6..10c98e3 100644 (file)
@@ -440,7 +440,7 @@ public class ValaProjectSettingsPopover : Object
             this.el.clear();
             var pal = (Palete.Gtk) _this.project.palete;
             var pkgs = pal.packages(_this.project);
-            print("ValaProjectSettings:packages load %d\n", pkgs.size);
+            GLib.debug("ValaProjectSettings:packages load %d\n", pkgs.size);
         
             Gtk.TreeIter citer;
         
@@ -940,28 +940,28 @@ public class ValaProjectSettingsPopover : Object
 
             //listeners
             this.el.activate.connect( ()  => {
-                
-                 //
-                    Gtk.TreeModel mod;
-                    Gtk.TreeIter iter;
-                    if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {
-                           print("nothing selected\n");
-                        return;
-                    }
             
-                        
-                   // add the directory..
-                   
-                   
-                   GLib.Value val;
-                    mod.get_value(iter,0, out val);
-                   var fn =  (string) val;
-                   
-                   print("remove: %s\n", fn);
-                   if (!_this.project.compilegroups.get("_default_").sources.remove(fn)) {
-                              print("remove failed");
-                          }
-                   _this.default_directory_tree_store.load();
+               //
+               Gtk.TreeModel mod;
+               Gtk.TreeIter iter;
+               if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {
+                       GLib.debug("nothing selected\n");
+                       return;
+               }
+            
+                       
+               // add the directory..
+            
+            
+               GLib.Value val;
+               mod.get_value(iter,0, out val);
+               var fn =  (string) val;
+            
+               GLib.debug("remove: %s\n", fn);
+               if (!_this.project.compilegroups.get("_default_").sources.remove(fn)) {
+                       GLib.debug("remove failed");
+               }
+               _this.default_directory_tree_store.load();
             });
         }
 
@@ -1145,27 +1145,27 @@ public class ValaProjectSettingsPopover : Object
             //listeners
             this.el.activate.connect( ()  => {
                 
-                 //
-                    Gtk.TreeModel mod;
-                    Gtk.TreeIter iter;
-                    if (!_this.targets_tree.el.get_selection().get_selected(out mod, out iter)) {
-                           print("nothing selected\n");
-                        return;
-                    }
+               //
+               Gtk.TreeModel mod;
+               Gtk.TreeIter iter;
+               if (!_this.targets_tree.el.get_selection().get_selected(out mod, out iter)) {
+                       GLib.debug("nothing selected\n");
+                       return;
+               }
             
-                        
-                   // add the directory..
-                   
-                   
-                   GLib.Value val;
-                    mod.get_value(iter,0, out val);
-                   var fn =  (string) val;
-                   
-                   print("remove: %s\n", fn);
-                   if (!_this.project.compilegroups.unset(fn)) {
-                              print("remove failed");
-                  }
-                   _this.targets_tree_store.load();
+            
+               // add the directory..
+            
+            
+               GLib.Value val;
+               mod.get_value(iter,0, out val);
+               var fn =  (string) val;
+            
+               GLib.debug("remove: %s\n", fn);
+               if (!_this.project.compilegroups.unset(fn)) {
+                       GLib.debug("remove failed");
+               }
+               _this.targets_tree_store.load();
             });
         }
 
@@ -1227,40 +1227,40 @@ public class ValaProjectSettingsPopover : Object
             });
             this.el.cursor_changed.connect( ( ) => {
             
-                if (this.cursor != "") {
-                     // save the values..
-                 }
-                 
-                 // load the new values.
-                 
+               if (this.cursor != "") {
+                       // save the values..
+               }
+            
+               // load the new values.
+            
+            
+               Gtk.TreeModel mod;
+               Gtk.TreeIter iter;
+               if (!this.el.get_selection().get_selected(out mod, out iter)) {
+                       GLib.debug("nothing selected\n");
+                       // should disable the right hand side..
+                       _this.set_vbox.el.hide();
+                       return;
+               }
+               _this.set_vbox.el.show();
+            
+               // add the directory..
+            
+            
+               GLib.Value val;
+               mod.get_value(iter,0, out val);
+               var fn =  (string) val;
+            
+               this.cursor = fn;
+               var cg = _this.project.compilegroups.get(fn);
+            
+               _this.build_pack_target.el.set_text(cg.target_bin);
+               _this.build_compile_flags.el.set_text(cg.compile_flags);
+               _this.build_execute_args.el.set_text(cg.execute_args);
+            
+               _this.set_vbox.cgroup = cg;
+               _this.files_tree_store.update();
             
-                     Gtk.TreeModel mod;
-                    Gtk.TreeIter iter;
-                    if (!this.el.get_selection().get_selected(out mod, out iter)) {
-                        print("nothing selected\n");
-                        // should disable the right hand side..
-                        _this.set_vbox.el.hide();
-                        return;
-                    }
-                    _this.set_vbox.el.show();
-                        
-                   // add the directory..
-                   
-                   
-                   GLib.Value val;
-                    mod.get_value(iter,0, out val);
-                   var fn =  (string) val;
-                   
-                   this.cursor = fn;
-                   var cg = _this.project.compilegroups.get(fn);
-                   
-                   _this.build_pack_target.el.set_text(cg.target_bin);
-                   _this.build_compile_flags.el.set_text(cg.compile_flags);
-                       _this.build_execute_args.el.set_text(cg.execute_args);
-                   
-                   _this.set_vbox.cgroup = cg;
-                   _this.files_tree_store.update();
-                   
                    // load the srouces
             
             
@@ -1789,7 +1789,7 @@ public class ValaProjectSettingsPopover : Object
                 this.el.set_value(citer, 1,   "<span foreground=\"green\" font_weight=\"bold\">" + 
                             GLib.Markup.escape_text(items.get(i)) + "</span>"
                     ); // title 
-                print("ADD item %s", items.get(i));
+                GLib.debug("ADD item %s", items.get(i));
                 this.el.set_value(citer, 2,   "dir"); // type         
                 this.el.set_value(citer, 3,   false ); // checked 
         
@@ -1797,7 +1797,7 @@ public class ValaProjectSettingsPopover : Object
                 
                  for(var j =0 ; j < files.size; j++) {
                     this.el.append(out citer);   
-                     print("ADD item %s", files.get(j));
+                     GLib.debug("ADD item %s", files.get(j));
                     this.el.set_value(citer, 0,   files.get(j) ); // title 
                     this.el.set_value(citer, 1,   GLib.Markup.escape_text( Path.get_basename (files.get(j))) ); // title             
                     this.el.set_value(citer, 2,   "file"); // type         
index 0a5620e..9016c84 100644 (file)
     },
     {
         "name" : "_default_",
-        "compile_flags" : "--thread -X -lm --target-glib=2.32 -g --pkg  roojspacker-1.0",
+        "compile_flags" : "--thread -X -lm --target-glib=2.32 -g  ",
         "execute_args" : "",
         "target_bin" : "",
         "sources" : [