From 97bf1cb406f6d8f976f10728162ab13bf1736e23 Mon Sep 17 00:00:00 2001 From: prculley Date: Thu, 2 Mar 2017 11:30:43 -0600 Subject: [PATCH] Bug 9973; fix remove unused objects tool to use place name not title original 'title' field is often blank now... --- gramps/plugins/tool/removeunused.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gramps/plugins/tool/removeunused.py b/gramps/plugins/tool/removeunused.py index c5b63c47f..0caf3fbda 100644 --- a/gramps/plugins/tool/removeunused.py +++ b/gramps/plugins/tool/removeunused.py @@ -100,7 +100,7 @@ class RemoveUnused(tool.Tool, ManagedWindow, UpdateCallback): 'name_ix': 3}, 'places': {'get_func': self.db.get_place_from_handle, 'remove': self.db.remove_place, - 'get_text': None, + 'get_text': self.get_place_text, 'editor': 'EditPlace', 'icon': 'gramps-place', 'name_ix': 2}, @@ -435,6 +435,17 @@ class RemoveUnused(tool.Tool, ManagedWindow, UpdateCallback): return text + def get_place_text(self, the_type, handle, data): + """ + We need just the place name. + """ + # get the place object + place = self.tables[the_type]['get_func'](handle) + + # get the name + text = place.get_name().get_value() + + return text #------------------------------------------------------------------------ # #