9127 : Geography : performance issue due to bad initialization.

This commit is contained in:
SNoiraud 2015-12-26 17:18:05 +01:00
parent 04c39a72e0
commit 822fa7c06c
7 changed files with 18 additions and 11 deletions

View File

@ -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()

View File

@ -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()

View File

@ -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()

View File

@ -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

View File

@ -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

View File

@ -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')

View File

@ -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