diff --git a/gramps2/src/FamilyView.py b/gramps2/src/FamilyView.py
index f8125609f..465735397 100644
--- a/gramps2/src/FamilyView.py
+++ b/gramps2/src/FamilyView.py
@@ -899,9 +899,10 @@ class FamilyView:
def find_marriage(self,family):
for event_id in family.get_event_list():
- event = self.parent.db.find_event_from_id(event_id)
- if event and event.get_name() == "Marriage":
- return event
+ if event_id:
+ event = self.parent.db.find_event_from_id(event_id)
+ if event.get_name() == "Marriage":
+ return event
return None
def update_list(self,model,tree,person):
diff --git a/gramps2/src/ReadXML.py b/gramps2/src/ReadXML.py
index 61a9237c7..e8bc31977 100644
--- a/gramps2/src/ReadXML.py
+++ b/gramps2/src/ReadXML.py
@@ -144,29 +144,30 @@ def importData(database, filename, callback,cl=0):
#-------------------------------------------------------------------------
def remove_clicked():
# File is lost => remove all references and the object itself
- mobj = ObjectMap[NewMediaID]
- for p in database.get_family_id_map().values():
+ mobj = database.find_object_from_id(NewMediaID)
+ for fid in database.get_family_keys():
+ p = database.find_family_from_id(fid)
nl = p.get_media_list()
for o in nl:
if o.get_reference() == mobj:
nl.remove(o)
p.set_media_list(nl)
for key in database.get_person_keys():
- p = database.get_person(key)
+ p = database.find_person_from_id(key)
nl = p.get_media_list()
for o in nl:
- if o.get_reference() == mobj:
+ if o.get_reference_id() == mobj.get_id():
nl.remove(o)
p.set_media_list(nl)
for key in database.get_source_keys():
- p = database.get_source(key)
+ p = database.find_source_from_id(key)
nl = p.get_media_list()
for o in nl:
- if o.get_reference() == mobj:
+ if o.get_reference_id() == mobj.get_id():
nl.remove(o)
p.set_media_list(nl)
for key in database.get_place_id_keys():
- p = database.get_place_id(key)
+ p = database.find_place_from_id(key)
nl = p.get_media_list()
for o in nl:
if o.get_reference() == mobj:
@@ -201,8 +202,6 @@ def importData(database, filename, callback,cl=0):
fs_top.run()
fs_top.destroy()
-#-------------------------------------------------------------------------
-
# # Rename media files if they were conflicting with existing ones
# newpath = database.get_save_path()
# for old_media_id in parser.media_file_map.keys():
diff --git a/gramps2/src/RelLib.py b/gramps2/src/RelLib.py
index a1472d0ad..f893a9f88 100644
--- a/gramps2/src/RelLib.py
+++ b/gramps2/src/RelLib.py
@@ -1961,6 +1961,7 @@ class Family(SourceNote):
def add_event_id(self,event_id):
"""adds an Event to the event list"""
+ assert(event_id != None)
self.event_list.append(event_id)
def get_event_list(self) :
@@ -2901,12 +2902,12 @@ class GrampsDB:
if map.has_key(str(idVal)):
place = Place()
- data = self.place_map[map[str(idVal)]]
+ data = self.place_map[str(map[idVal])]
place.unserialize(data)
else:
place = Place()
if self.place_map.has_key(str(idVal)):
- map[str(idVal)] = self.add_place(place)
+ map[idVal] = self.add_place(place)
else:
place.set_id(str(idVal))
map[str(idVal)] = self.add_place_as(place)
@@ -3108,7 +3109,7 @@ class GrampsDB:
family = self.new_family()
else:
family = self.new_family_no_map(str(idVal))
- map[str(idVal)] = family.get_id()
+ map[idVal] = family.get_id()
return family
def find_source_no_conflicts(self,idVal,map):
diff --git a/gramps2/src/gramps.glade b/gramps2/src/gramps.glade
index cea64db52..bbfa4104c 100644
--- a/gramps2/src/gramps.glade
+++ b/gramps2/src/gramps.glade
@@ -51,7 +51,7 @@
-
+
True
gtk-new
1
@@ -73,7 +73,7 @@
-
+
True
gtk-open
1
@@ -107,7 +107,7 @@
True
-
+
True
gtk-convert
1
@@ -120,27 +120,6 @@
-
-
-
-