[gnome-builder] todo plugin: create the panel before using it



commit 30a1701269c7ef701e35191b50c54163dcaa6790
Author: Sebastien Lafargue <slafargue gnome org>
Date:   Thu Mar 24 10:41:51 2016 +0100

    todo plugin: create the panel before using it
    
    Fix the case where we clear the panel
    on file changes before having created it.

 plugins/todo/todo_plugin/__init__.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/plugins/todo/todo_plugin/__init__.py b/plugins/todo/todo_plugin/__init__.py
index 18e461a..11904af 100644
--- a/plugins/todo/todo_plugin/__init__.py
+++ b/plugins/todo/todo_plugin/__init__.py
@@ -45,10 +45,7 @@ class TodoWorkbenchAddin(GObject.Object, Ide.WorkbenchAddin):
     def do_load(self, workbench):
         self.workbench = workbench
 
-        # Watch the buffer manager for file changes (to update)
         context = workbench.get_context()
-        bufmgr = context.get_buffer_manager()
-        bufmgr.connect('buffer-saved', self.on_buffer_saved)
 
         # Get the working directory of the project
         vcs = context.get_vcs()
@@ -60,6 +57,10 @@ class TodoWorkbenchAddin(GObject.Object, Ide.WorkbenchAddin):
         pane = editor.get_bottom_edge()
         pane.add(self.panel)
 
+        # Watch the buffer manager for file changes (to update)
+        bufmgr = context.get_buffer_manager()
+        bufmgr.connect('buffer-saved', self.on_buffer_saved)
+
         # Mine the directory in a background thread
         self.mine(workdir)
 


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