From 44ae41107d557e7de01af17f07d90e8bc3432e4e Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Sat, 26 Dec 2015 15:42:55 +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 72e0349b7..22d0f8c03 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 3a560e765..eab093acc 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 a800c8ff4..4d1b37766 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 788b977f2..ebccc2dc1 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): @@ -362,6 +361,9 @@ class GeoFamily(GeoGraphyView): """ 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 7d443cd91..2edd26c3e 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 f9ae36b99..b0900b6ac 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 14da915c5..837601c1b 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