From d3d2f0624cd665e53fc0b3411f5b53f7b36b91e1 Mon Sep 17 00:00:00 2001 From: Serge Noiraud Date: Sun, 29 May 2011 21:36:44 +0000 Subject: [PATCH] Geography : bug when linking to a place. svn: r17621 --- src/plugins/lib/maps/geography.py | 9 ++++++--- src/plugins/view/geoplaces.py | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plugins/lib/maps/geography.py b/src/plugins/lib/maps/geography.py index 23acb31e7..1db09f529 100644 --- a/src/plugins/lib/maps/geography.py +++ b/src/plugins/lib/maps/geography.py @@ -903,9 +903,12 @@ class GeoGraphyView(osmGpsMap, NavigationView): if place: loc = place.get_main_location() oldv = (loc.get_country(), loc.get_state(), loc.get_county()) if loc else None - for m in self.place_list: - if m[0] == place.get_title(): - self.mark = m + places_handle = self.dbstate.db.iter_place_handles() + for place_hdl in places_handle: + plce = self.dbstate.db.get_place_from_handle(place_hdl) + if plce.get_title() == place.get_title(): + self.mark = [None,None,None,None,None,None,None, + None,None,plce.gramps_id,None,None] PlaceSelection(self.uistate, self.dbstate, self.osm, self.selection_layer, self.place_list, lat, lon, self.__edit_place, oldv) diff --git a/src/plugins/view/geoplaces.py b/src/plugins/view/geoplaces.py index 395918efd..8d5839fb7 100644 --- a/src/plugins/view/geoplaces.py +++ b/src/plugins/view/geoplaces.py @@ -201,6 +201,8 @@ class GeoPlaces(GeoGraphyView): """ Create one entry for one place with a lat/lon. """ + if place is None: + return descr = place.get_title() longitude = place.get_longitude() latitude = place.get_latitude()