From 822fa7c06caf76c66af531bd82382e66708ad8ec Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Sat, 26 Dec 2015 17:18:05 +0100 Subject: [PATCH] 9127 : Geography : performance issue due to bad initialization. --- gramps/plugins/view/geoclose.py | 2 ++ gramps/plugins/view/geoevents.py | 8 +++----- gramps/plugins/view/geofamclose.py | 2 ++ gramps/plugins/view/geofamily.py | 4 +++- gramps/plugins/view/geomoves.py | 5 +++-- gramps/plugins/view/geoperson.py | 4 +++- gramps/plugins/view/geoplaces.py | 4 ++-- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/gramps/plugins/view/geoclose.py b/gramps/plugins/view/geoclose.py index c92da4682..9caf3ce06 100644 --- a/gramps/plugins/view/geoclose.py +++ b/gramps/plugins/view/geoclose.py @@ -206,6 +206,8 @@ class GeoClose(GeoGraphyView): self.all_place_list = [] self.sort = [] self.places_found = [] + self.nbmarkers = 0 + self.nbplaces = 0 self.place_without_coordinates = [] self.remove_all_gps() self.remove_all_markers() diff --git a/gramps/plugins/view/geoevents.py b/gramps/plugins/view/geoevents.py index 85bcbbe87..2cc0704d4 100644 --- a/gramps/plugins/view/geoevents.py +++ b/gramps/plugins/view/geoevents.py @@ -263,10 +263,6 @@ class GeoEvents(GeoGraphyView): event.gramps_id, None ) - else: - descr = _pd.display(dbstate.db, place) - self._append_to_places_without_coord( - place.gramps_id, descr) def _createmap(self,obj): """ @@ -275,16 +271,18 @@ class GeoEvents(GeoGraphyView): """ dbstate = self.dbstate self.place_list = [] + self.places_found = [] self.place_without_coordinates = [] self.minlat = self.maxlat = self.minlon = self.maxlon = 0.0 self.minyear = 9999 self.maxyear = 0 + self.nbmarkers = 0 + self.nbplaces = 0 latitude = "" longitude = "" self.without = 0 self.cal = config.get('preferences.calendar-format-report') self.no_show_places_in_status_bar = False - if self.show_all: self.show_all = False events_handle = dbstate.db.get_event_handles() diff --git a/gramps/plugins/view/geofamclose.py b/gramps/plugins/view/geofamclose.py index 2f8c4d620..bced7fcbe 100644 --- a/gramps/plugins/view/geofamclose.py +++ b/gramps/plugins/view/geofamclose.py @@ -235,6 +235,8 @@ class GeoFamClose(GeoGraphyView): self.sort = [] self.places_found = [] self.place_without_coordinates = [] + self.nbmarkers = 0 + self.nbplaces = 0 self.remove_all_gps() self.remove_all_markers() self.lifeway_layer.clear_ways() diff --git a/gramps/plugins/view/geofamily.py b/gramps/plugins/view/geofamily.py index a9a7e951a..cf2fee6bb 100644 --- a/gramps/plugins/view/geofamily.py +++ b/gramps/plugins/view/geofamily.py @@ -170,7 +170,6 @@ class GeoFamily(GeoGraphyView): """ Rebuild the tree with the given person handle as the root. """ - self.places_found = [] self.build_tree() def build_tree(self): @@ -364,6 +363,9 @@ class GeoFamily(GeoGraphyView): return self.place_list = [] self.place_without_coordinates = [] + self.places_found = [] + self.nbplaces = 0 + self.nbmarkers = 0 self.minlat = self.maxlat = self.minlon = self.maxlon = 0.0 self.minyear = 9999 self.maxyear = 0 diff --git a/gramps/plugins/view/geomoves.py b/gramps/plugins/view/geomoves.py index 97603ce3f..07e15d863 100644 --- a/gramps/plugins/view/geomoves.py +++ b/gramps/plugins/view/geomoves.py @@ -207,8 +207,6 @@ class GeoMoves(GeoGraphyView): self.place_list_active = [] self.place_list_ref = [] self.sort = [] - self.places_found = [] - self.place_without_coordinates = [] self.remove_all_gps() self.remove_all_markers() self.lifeway_layer.clear_ways() @@ -459,6 +457,9 @@ class GeoMoves(GeoGraphyView): self.minlat = self.maxlat = self.minlon = self.maxlon = 0.0 latitude = "" longitude = "" + self.places_found = [] + self.nbplaces = 0 + self.nbmarkers = 0 self.message_layer.clear_messages() self.place_without_coordinates = [] self.minlat = self.maxlat = self.minlon = self.maxlon = 0.0 diff --git a/gramps/plugins/view/geoperson.py b/gramps/plugins/view/geoperson.py index be039aed6..3082bd728 100644 --- a/gramps/plugins/view/geoperson.py +++ b/gramps/plugins/view/geoperson.py @@ -201,7 +201,6 @@ class GeoPerson(GeoGraphyView): """ Rebuild the tree with the given person handle as the root. """ - self.places_found = [] active = self.get_active() if handle: self._createmap(handle) @@ -296,11 +295,14 @@ class GeoPerson(GeoGraphyView): self.cal = config.get('preferences.calendar-format-report') self.place_list = [] self.place_without_coordinates = [] + self.places_found = [] self.minlat = self.maxlat = self.minlon = self.maxlon = 0.0 self.minyear = 9999 self.maxyear = 0 latitude = "" longitude = "" + self.nbplaces = 0 + self.nbmarkers = 0 self.message_layer.clear_messages() self.kml_layer.clear() person_handle = self.uistate.get_active('Person') diff --git a/gramps/plugins/view/geoplaces.py b/gramps/plugins/view/geoplaces.py index a68ea3308..62aba2a5b 100644 --- a/gramps/plugins/view/geoplaces.py +++ b/gramps/plugins/view/geoplaces.py @@ -180,6 +180,7 @@ class GeoPlaces(GeoGraphyView): Ask to show all places. """ self.show_all = True + self.nbmarkers = 0 self._createmap(None) def build_tree(self): @@ -219,8 +220,6 @@ class GeoPlaces(GeoGraphyView): None, # event.gramps_id None # family.gramps_id ) - else: - self._append_to_places_without_coord(place.gramps_id, descr) def _createmap(self,place_x): """ @@ -230,6 +229,7 @@ class GeoPlaces(GeoGraphyView): dbstate = self.dbstate self.cal = config.get('preferences.calendar-format-report') self.place_list = [] + self.places_found = [] self.place_without_coordinates = [] self.minlat = 0.0 self.maxlat = 0.0