Monitor.vala
[gitlive] / Monitor.vala
index 6cf96e8..408559f 100644 (file)
@@ -13,7 +13,7 @@ using Gee; // for array list?
 static int main (string[] args) {
     // A reference to our file
     var file = File.new_for_path ("data.txt");
-
+    return 0;
 
 }
 
@@ -83,8 +83,8 @@ public class Monitor : Object
      */
     public void start()
     {
-        foreach(var in in this.top) {
-            this.monitor(this.top[i]);
+        for(int i = 0; i < this.monitors.size ; i++) {
+            this.monitor(this.top[i], "" , 0);
         }
     }
     /**
@@ -94,7 +94,7 @@ public class Monitor : Object
     public void stop()
     {
         
-        foreach(var i in  this.monitors) {
+        for(int i = 0; i < this.monitors.size ; i++) {
             this.monitors[i].cancel();
         } 
         this.monitors = new ArrayList<FileMonitor>(); // clean /destroy/ kill old?
@@ -120,7 +120,7 @@ public class Monitor : Object
      * 
      * 
      */
-    public void monitor(string path, string fn, int depth)
+    public void monitor(string path, Callback fn, int depth)
     {
          
        // print("ADD: " + path)
@@ -154,7 +154,7 @@ public class Monitor : Object
         
        
          var file_enum = f.enumerate_children(
-            FileAttribute.STANDARD_DISPLAY_NAME + ','+   FileAttribute.STANDARD_TYPE,
+            FileAttribute.STANDARD_DISPLAY_NAME + "," +   FileAttribute.STANDARD_TYPE,
             0, // FileQueryInfoFlags.NONE,
             null);
         
@@ -164,12 +164,12 @@ public class Monitor : Object
          
             //print("got a file " + next_file.sudo () + '?=' + Gio.FileType.DIRECTORY);
             
-            if (next_file.get_file_type() != FILETYPE_DIRECTORY) {
+            if (next_file.get_file_type() != FileType.DIRECTORY) {
                 next_file = null;
                 continue;
             }
             
-            if (next_file.get_file_type() == FILETYPE_SYMBOLIC_LINK) {
+            if (next_file.get_file_type() ==FileType.SYMBOLIC_LINK) {
                 next_file = null;
                 continue;
             }
@@ -178,7 +178,7 @@ public class Monitor : Object
                 next_file = null;
                 continue;
             }
-            var sp = path+'/'+next_file.get_display_name();
+            var sp = path+"/"+next_file.get_display_name();
             // skip modules.
             //print("got a file : " + sp);
          
@@ -241,7 +241,7 @@ public class Monitor : Object
             dest = new MonitorNamePathDir( of.get_basename(), of.get_path(),  Path.get_dirname(of.get_path()));
             
         }
-        string event_name = "UKNOWN";
+        //string event_name = "UKNOWN";
         
         
         // extract the event names ... - not sure if introspection is feasible in vala..