From 6282f400db59c128a070ab0d59ead7c7a83dcc49 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 1 May 2014 22:26:37 +0800 Subject: [PATCH] Monitor.vala --- Monitor.vala | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Monitor.vala b/Monitor.vala index 18d1935c..35bbf055 100644 --- a/Monitor.vala +++ b/Monitor.vala @@ -142,17 +142,23 @@ public class Monitor : Object var f = File.new_for_path(path); //var cancel = new Gio.Cancellable (); - if (depth > 0) { - var fm = f.monitor(FileMonitorFlags.SEND_MOVED,null); //Gio.FileMonitorFlags.SEND_MOVED - - fm.changed.connect( ( fm, f_orig, of_orig, event_type) => { - //if (fn) { - fn (fm, f_orig, of_orig, event_type ) ; - // return; - //} - //this.onEvent (fm, f_orig, of_orig, event_type ) ; - }); - this.monitors.add(fm); + if (depth > 0) { + try { + + var fm = f.monitor(FileMonitorFlags.SEND_MOVED,null); //Gio.FileMonitorFlags.SEND_MOVED + + fm.changed.connect( ( fm, f_orig, of_orig, event_type) => { + //if (fn) { + fn (fm, f_orig, of_orig, event_type ) ; + // return; + //} + //this.onEvent (fm, f_orig, of_orig, event_type ) ; + }); + this.monitors.add(fm); + + } catch (Error e) { + // do nothing.. + } // print("ADD path " + depth + ' ' + path); } // iterate children? -- 2.39.2