[meld] Small cleanup of selection handling



commit 6d223cdbf3d3109394d9bb3a141fa22a16a2958b
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Dec 9 06:34:13 2012 +1000

    Small cleanup of selection handling

 meld/vcview.py |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/meld/vcview.py b/meld/vcview.py
index 7c26f5e..74314f7 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -515,12 +515,9 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
             self.actiongroup.get_action(action).set_sensitive(have_selection)
 
     def _get_selected_files(self):
-        sel = []
-        def gather(model, path, it):
-            sel.append( model.value_path(it,0) )
-        s = self.treeview.get_selection()
-        s.selected_foreach(gather)
-        # remove empty entries and remove trailing slashes
+        model, rows = self.treeview.get_selection().get_selected_rows()
+        sel = [self.model.value_path(self.model.get_iter(r), 0) for r in rows]
+        # Remove empty entries and trailing slashes
         return [x[-1] != "/" and x or x[:-1] for x in sel if x is not None]
 
     def _command_iter(self, command, files, refresh):



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