8789: Use place title as default name in GEDCOM import
This commit is contained in:
parent
a121922310
commit
67e6c66555
@ -1714,8 +1714,12 @@ class PlaceParser(object):
|
|||||||
if name:
|
if name:
|
||||||
break
|
break
|
||||||
|
|
||||||
place.set_name(name)
|
if name:
|
||||||
type_num = 7 - level if name else PlaceType.UNKNOWN
|
type_num = 7 - level
|
||||||
|
else:
|
||||||
|
name = place.title
|
||||||
|
type_num = PlaceType.UNKNOWN
|
||||||
|
place.name.set_value(name)
|
||||||
place.set_type(PlaceType(type_num))
|
place.set_type(PlaceType(type_num))
|
||||||
code = loc.get_postal_code()
|
code = loc.get_postal_code()
|
||||||
place.set_code(code)
|
place.set_code(code)
|
||||||
@ -4541,6 +4545,7 @@ class GedcomParser(UpdateCallback):
|
|||||||
if place is None:
|
if place is None:
|
||||||
place = Place()
|
place = Place()
|
||||||
place.set_title(title)
|
place.set_title(title)
|
||||||
|
place.name.set_value(title)
|
||||||
self.dbase.add_place(place, self.trans)
|
self.dbase.add_place(place, self.trans)
|
||||||
self.place_names[place.get_title()].append(place.get_handle())
|
self.place_names[place.get_title()].append(place.get_handle())
|
||||||
else:
|
else:
|
||||||
@ -5399,11 +5404,13 @@ class GedcomParser(UpdateCallback):
|
|||||||
else:
|
else:
|
||||||
# This is the first PLAC
|
# This is the first PLAC
|
||||||
place.set_title(line.data)
|
place.set_title(line.data)
|
||||||
|
place.name.set_value(line.data)
|
||||||
else:
|
else:
|
||||||
# The first thing we encounter is PLAC
|
# The first thing we encounter is PLAC
|
||||||
state.place = Place()
|
state.place = Place()
|
||||||
place = state.place
|
place = state.place
|
||||||
place.set_title(line.data)
|
place.set_title(line.data)
|
||||||
|
place.name.set_value(line.data)
|
||||||
|
|
||||||
sub_state = CurrentState()
|
sub_state = CurrentState()
|
||||||
sub_state.place = place
|
sub_state.place = place
|
||||||
|
Loading…
Reference in New Issue
Block a user