[meld] dirdiff: Small refactor of set_num_panes()



commit 9a03d2588dc77a133dc3bd948fd7b4cdcc4ba6a3
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Oct 23 08:23:02 2016 +1000

    dirdiff: Small refactor of set_num_panes()
    
    The change to avoid the refresh is deliberate; we've never supported
    this and it won't work properly anyway.

 meld/dirdiff.py | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/meld/dirdiff.py b/meld/dirdiff.py
index 17d48a75..54b60156 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -1419,9 +1419,9 @@ class DirDiff(melddoc.MeldDoc, gnomeglade.Component):
             return
 
         self.model = DirDiffTreeStore(num_panes)
-        for i in range(num_panes):
-            self.treeview[i].set_model(self.model)
         self.model.connect("row-deleted", self.on_treemodel_row_deleted)
+        for treeview in self.treeview:
+            treeview.set_model(self.model)
 
         for (w, i) in zip(self.diffmap, (0, num_panes - 1)):
             scroll = self.scrolledwindow[i].get_vscrollbar()
@@ -1440,11 +1440,7 @@ class DirDiff(melddoc.MeldDoc, gnomeglade.Component):
                 self.dummy_toolbar_linkmap[num_panes - 1:]):
             widget.hide()
 
-        if self.num_panes != 0:  # not first time through
-            self.num_panes = num_panes
-            self.on_fileentry_file_set(None)
-        else:
-            self.num_panes = num_panes
+        self.num_panes = num_panes
 
     def refresh(self):
         root = self.model.get_iter_first()


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