[meld] Perform state conversion in DiffTreeStore



commit cd977a2349cd7596741766895c66c67252c9291c
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Jan 30 11:26:32 2011 +1000

    Perform state conversion in DiffTreeStore

 meld/dirdiff.py |    4 ++--
 meld/tree.py    |    2 +-
 meld/vcview.py  |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/meld/dirdiff.py b/meld/dirdiff.py
index 9f182a9..f3dc628 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -936,7 +936,7 @@ class DirDiff(melddoc.MeldDoc, gnomeglade.Component):
         for c in chunks[1:]:
             end = start + c[0]
             s,e = [int(x) for x in (math.floor(scaleit(start)), math.ceil(scaleit(end))) ]
-            gc = area.meldgc[ int(c[1]) ]
+            gc = area.meldgc[c[1]]
             if gc:
                 window.draw_rectangle( gc, 1, x0, s, x1, e-s)
                 window.draw_rectangle( area.meldgc[-1], 0, x0, s, x1, e-s)
@@ -1005,7 +1005,7 @@ class DirDiff(melddoc.MeldDoc, gnomeglade.Component):
 
         search = {gtk.gdk.SCROLL_UP : self.model.inorder_search_up}.get(direction, self.model.inorder_search_down)
         for it in search( start_iter ):
-            state = int(self.model.get_state( it, pane ))
+            state = self.model.get_state(it, pane)
             if state not in (tree.STATE_NORMAL, tree.STATE_EMPTY):
                 curpath = self.model.get_path(it)
                 self.treeview[pane].expand_to_path(curpath)
diff --git a/meld/tree.py b/meld/tree.py
index a052452..d60f56e 100644
--- a/meld/tree.py
+++ b/meld/tree.py
@@ -126,7 +126,7 @@ class DiffTreeStore(gtk.TreeStore):
 
     def get_state(self, it, pane):
         STATE = self.column_index(COL_STATE, pane)
-        return self.get_value(it, STATE)
+        return int(self.get_value(it, STATE))
 
     def inorder_search_down(self, it):
         while it:
diff --git a/meld/vcview.py b/meld/vcview.py
index b83b00a..51f281b 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -665,7 +665,7 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
 
         search = {gtk.gdk.SCROLL_UP : self.model.inorder_search_up}.get(direction, self.model.inorder_search_down)
         for it in search( start_iter ):
-            state = int(self.model.get_state( it, 0))
+            state = self.model.get_state(it, 0)
             if state not in (tree.STATE_NORMAL, tree.STATE_EMPTY):
                 curpath = self.model.get_path(it)
                 self.treeview.expand_to_path(curpath)



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