[meld] Make expanded a set and use expand_to_path API
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Make expanded a set and use expand_to_path API
- Date: Sat, 5 Feb 2011 22:54:39 +0000 (UTC)
commit 9cafe336ab648e848ac4f6bd85872e96a1a4d7ec
Author: Kai Willadsen <kai willadsen gmail com>
Date: Wed Dec 1 06:13:00 2010 +1000
Make expanded a set and use expand_to_path API
meld/dirdiff.py | 16 ++++------------
1 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/meld/dirdiff.py b/meld/dirdiff.py
index 35dd8e6..d3e42ac 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -358,7 +358,7 @@ class DirDiff(melddoc.MeldDoc, gnomeglade.Component):
prefixlen = 1 + len( self.model.value_path( self.model.get_iter(rootpath), 0 ) )
symlinks_followed = {} # only follow symlinks once
todo = [ rootpath ]
- expanded = {}
+ expanded = set()
while len(todo):
todo.sort() # depth first
path = todo.pop(0)
@@ -468,17 +468,9 @@ class DirDiff(melddoc.MeldDoc, gnomeglade.Component):
else: # directory is empty, add a placeholder
self.model.add_empty(it)
if differences:
- expanded[path] = False
- for path in sorted(expanded.keys()):
- start = path[:]
- while len(start) and not expanded.get(start,False):
- start = start[:-1]
- level = len(start)
- while level < len(path):
- level += 1
- cur = path[:level]
- expanded[cur] = True
- self.treeview[0].expand_row( cur, 0)
+ expanded.add(path)
+ for path in sorted(expanded):
+ self.treeview[0].expand_to_path(path)
yield _("[%s] Done") % self.label_text
self.actiongroup.get_action("Hide").set_sensitive(True)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]