Commit 23b5de89 authored by Kai Willadsen's avatar Kai Willadsen

tree: Add a helper to iterate over rows matching a set of states

parent b87a5240
......@@ -241,3 +241,14 @@ class DiffTreeStore(Gtk.TreeStore):
if key in text:
return False
return True
def state_rows(self, states):
"""Generator of rows in one of the given states
Tree iterators are returned in depth-first tree order.
root = self.get_iter_first()
for it in self.inorder_search_down(root):
state = self.get_state(it, 0)
if state in states:
yield it
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment