9127 : Geography : performance issue due to bad initialization.

This commit is contained in:
SNoiraud 2015-12-26 15:42:55 +01:00
parent d5f871e8e7
commit 44ae41107d
7 changed files with 18 additions and 11 deletions

View File

@ -206,6 +206,8 @@ class GeoClose(GeoGraphyView):
self.all_place_list = [] self.all_place_list = []
self.sort = [] self.sort = []
self.places_found = [] self.places_found = []
self.nbmarkers = 0
self.nbplaces = 0
self.place_without_coordinates = [] self.place_without_coordinates = []
self.remove_all_gps() self.remove_all_gps()
self.remove_all_markers() self.remove_all_markers()

View File

@ -263,10 +263,6 @@ class GeoEvents(GeoGraphyView):
event.gramps_id, event.gramps_id,
None None
) )
else:
descr = _pd.display(dbstate.db, place)
self._append_to_places_without_coord(
place.gramps_id, descr)
def _createmap(self,obj): def _createmap(self,obj):
""" """
@ -275,16 +271,18 @@ class GeoEvents(GeoGraphyView):
""" """
dbstate = self.dbstate dbstate = self.dbstate
self.place_list = [] self.place_list = []
self.places_found = []
self.place_without_coordinates = [] self.place_without_coordinates = []
self.minlat = self.maxlat = self.minlon = self.maxlon = 0.0 self.minlat = self.maxlat = self.minlon = self.maxlon = 0.0
self.minyear = 9999 self.minyear = 9999
self.maxyear = 0 self.maxyear = 0
self.nbmarkers = 0
self.nbplaces = 0
latitude = "" latitude = ""
longitude = "" longitude = ""
self.without = 0 self.without = 0
self.cal = config.get('preferences.calendar-format-report') self.cal = config.get('preferences.calendar-format-report')
self.no_show_places_in_status_bar = False self.no_show_places_in_status_bar = False
if self.show_all: if self.show_all:
self.show_all = False self.show_all = False
events_handle = dbstate.db.get_event_handles() events_handle = dbstate.db.get_event_handles()

View File

@ -235,6 +235,8 @@ class GeoFamClose(GeoGraphyView):
self.sort = [] self.sort = []
self.places_found = [] self.places_found = []
self.place_without_coordinates = [] self.place_without_coordinates = []
self.nbmarkers = 0
self.nbplaces = 0
self.remove_all_gps() self.remove_all_gps()
self.remove_all_markers() self.remove_all_markers()
self.lifeway_layer.clear_ways() 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. Rebuild the tree with the given person handle as the root.
""" """
self.places_found = []
self.build_tree() self.build_tree()
def build_tree(self): def build_tree(self):
@ -362,6 +361,9 @@ class GeoFamily(GeoGraphyView):
""" """
self.place_list = [] self.place_list = []
self.place_without_coordinates = [] self.place_without_coordinates = []
self.places_found = []
self.nbplaces = 0
self.nbmarkers = 0
self.minlat = self.maxlat = self.minlon = self.maxlon = 0.0 self.minlat = self.maxlat = self.minlon = self.maxlon = 0.0
self.minyear = 9999 self.minyear = 9999
self.maxyear = 0 self.maxyear = 0

View File

@ -207,8 +207,6 @@ class GeoMoves(GeoGraphyView):
self.place_list_active = [] self.place_list_active = []
self.place_list_ref = [] self.place_list_ref = []
self.sort = [] self.sort = []
self.places_found = []
self.place_without_coordinates = []
self.remove_all_gps() self.remove_all_gps()
self.remove_all_markers() self.remove_all_markers()
self.lifeway_layer.clear_ways() self.lifeway_layer.clear_ways()
@ -459,6 +457,9 @@ class GeoMoves(GeoGraphyView):
self.minlat = self.maxlat = self.minlon = self.maxlon = 0.0 self.minlat = self.maxlat = self.minlon = self.maxlon = 0.0
latitude = "" latitude = ""
longitude = "" longitude = ""
self.places_found = []
self.nbplaces = 0
self.nbmarkers = 0
self.message_layer.clear_messages() self.message_layer.clear_messages()
self.place_without_coordinates = [] self.place_without_coordinates = []
self.minlat = self.maxlat = self.minlon = self.maxlon = 0.0 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. Rebuild the tree with the given person handle as the root.
""" """
self.places_found = []
active = self.get_active() active = self.get_active()
if handle: if handle:
self._createmap(handle) self._createmap(handle)
@ -296,11 +295,14 @@ class GeoPerson(GeoGraphyView):
self.cal = config.get('preferences.calendar-format-report') self.cal = config.get('preferences.calendar-format-report')
self.place_list = [] self.place_list = []
self.place_without_coordinates = [] self.place_without_coordinates = []
self.places_found = []
self.minlat = self.maxlat = self.minlon = self.maxlon = 0.0 self.minlat = self.maxlat = self.minlon = self.maxlon = 0.0
self.minyear = 9999 self.minyear = 9999
self.maxyear = 0 self.maxyear = 0
latitude = "" latitude = ""
longitude = "" longitude = ""
self.nbplaces = 0
self.nbmarkers = 0
self.message_layer.clear_messages() self.message_layer.clear_messages()
self.kml_layer.clear() self.kml_layer.clear()
person_handle = self.uistate.get_active('Person') person_handle = self.uistate.get_active('Person')

View File

@ -180,6 +180,7 @@ class GeoPlaces(GeoGraphyView):
Ask to show all places. Ask to show all places.
""" """
self.show_all = True self.show_all = True
self.nbmarkers = 0
self._createmap(None) self._createmap(None)
def build_tree(self): def build_tree(self):
@ -219,8 +220,6 @@ class GeoPlaces(GeoGraphyView):
None, # event.gramps_id None, # event.gramps_id
None # family.gramps_id None # family.gramps_id
) )
else:
self._append_to_places_without_coord(place.gramps_id, descr)
def _createmap(self,place_x): def _createmap(self,place_x):
""" """
@ -230,6 +229,7 @@ class GeoPlaces(GeoGraphyView):
dbstate = self.dbstate dbstate = self.dbstate
self.cal = config.get('preferences.calendar-format-report') self.cal = config.get('preferences.calendar-format-report')
self.place_list = [] self.place_list = []
self.places_found = []
self.place_without_coordinates = [] self.place_without_coordinates = []
self.minlat = 0.0 self.minlat = 0.0
self.maxlat = 0.0 self.maxlat = 0.0