[gedit-plugins] [git] Gracefully handle monitor creation failure



commit e92bd3f28aaba54d4d6910bd20700c35fab008f1
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Sun Jul 13 13:48:52 2014 +0200

    [git] Gracefully handle monitor creation failure

 plugins/git/git/windowactivatable.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/plugins/git/git/windowactivatable.py b/plugins/git/git/windowactivatable.py
index cef4bca..674e0cb 100644
--- a/plugins/git/git/windowactivatable.py
+++ b/plugins/git/git/windowactivatable.py
@@ -233,9 +233,12 @@ class GitWindowActivatable(GObject.Object, Gedit.WindowActivatable):
         self.monitors = {}
 
     def monitor_directory(self, location):
-        monitor = location.monitor(Gio.FileMonitorFlags.NONE, None)
-        self.monitors[location.get_uri()] = monitor
+        try:
+            monitor = location.monitor(Gio.FileMonitorFlags.NONE, None)
+        except:
+            return
 
+        self.monitors[location.get_uri()] = monitor
         monitor.connect('changed', self.monitor_changed)
 
     def monitor_changed(self, monitor, file, other_file, event_type):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]