2007-06-19 Alex Roitman <shura@gramps-project.org>

* src/FilterEditor/_FilterEditor.py (_do_delete_filter): Use a
	copy for iteration over the filters.



svn: r8596
This commit is contained in:
Alex Roitman 2007-06-19 17:07:41 +00:00
parent 7f1ab2cf01
commit f3d0e73c2c
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2007-06-19 Alex Roitman <shura@gramps-project.org>
* src/FilterEditor/_FilterEditor.py (_do_delete_filter): Use a
copy for iteration over the filters.
2007-06-18 Alex Roitman <shura@gramps-project.org>
* src/DateEdit.py (DateEditorDialog.switch_calendar): Only convert
non-empty dates to new calendar.

View File

@ -212,7 +212,10 @@ class FilterEditor(ManagedWindow.ManagedWindow):
and C is 'matches D' the removal of D leads to two broken filter
being left behind.
"""
filters = self.filterdb.get_filters(space)
# Use the copy of the filter list to iterate over, so that
# the removal of filters does not screw up the iteration
filters = self.filterdb.get_filters(space)[:]
name = gfilter.get_name()
for the_filter in filters:
for rule in the_filter.get_rules():
@ -221,7 +224,8 @@ class FilterEditor(ManagedWindow.ManagedWindow):
and (name in values):
self._do_delete_filter(space,the_filter)
break
filters.remove(gfilter)
# The actual removal is from the real filter list, not a copy.
self.filterdb.get_filters(space).remove(gfilter)
def get_all_handles(self):
if self.space == 'Person':