DictionaryDb had a bug where the same tag could end up in the name
mapping multiple times. This was most easily seen when loading a gramps
xml into a DictionaryDb, where an extra entry with the tag name of ''
would be created and would ultimately be referencing the last-created
Tag (also referenced by its proper tag name). This change makes sure
that when editing a tag, any existing references in the name mapping are
deleted before adding.
After finding a bug in a filter that caused it to return incomplete
results in master (not yet patched), I decided to develop tests for the
filter rules. This first batch is all listed person filter rules that
either take no parameters or take a single ID parameter. I originally
wanted to use the smaller data.gramps instead of example.gramps, but
there were more unrepresented edge cases that wouldn't allow for testing
all filters (e.g. disconnected individuals).
All test values are based on what Gramps currently returns, with some
efforts made to try to verify the results. If the example.gramps file
changes, these tests will likely have to be updated. I tried to
cross-version validate them with v4.1, but the implementation of
DictionaryDb is too incomplete and many tests fail for unrelated
reasons.
I can never remember which category filters are in when making a new
rule. This change adds a filter entry above the treeview. As you type,
filters that do not contain the search text (case insensitively) are
made not visible. Categories are always visible, but will no longer
expand if all of their child nodes are hidden.
These issues were all found while trying to use the "Calculate Previews"
feature of the export wizard.
gen/proxy/referencedbyselection.py: ProxyDbBase need not define the
writable functions (add_*, commit_*, del_*) in its __tables. ProxyDbBase
doesn't have methods for add_person, etc, so this was causing an
AttributeError
gen/proxy/referencedbyselection.py: Add some handle checks to prevent
lookups on None handles
gen/proxy/proxybase.py: remove redundant test