diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 529cc25e3..23ac3e3bb 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,8 @@ +2006-01-18 Alex Roitman + * src/GrampsDb/_GrampsBSDDB.py (load): Use BTREE for + reference_map; sort reference_map_referenced_map index. + * src/GrampsDb/_ReadGedcom.py (parse_record): Restore add def_src. + 2006-01-17 Don Allingham * src/DbPrompter.py: removed * src/gramps.glade: delete unused stuff diff --git a/gramps2/src/GrampsDb/_GrampsBSDDB.py b/gramps2/src/GrampsDb/_GrampsBSDDB.py index c1834a349..5a3cf2817 100644 --- a/gramps2/src/GrampsDb/_GrampsBSDDB.py +++ b/gramps2/src/GrampsDb/_GrampsBSDDB.py @@ -282,7 +282,10 @@ class GrampsBSDDB(GrampsDbBase): self.metadata = self.open_table(self.full_name, "meta") self.person_map = self.open_table(self.full_name, "person") self.repository_map = self.open_table(self.full_name, "repository") - self.reference_map = self.open_table(self.full_name, "reference_map") + self.reference_map = dbshelve.DBShelf(self.env) + self.reference_map.db.set_pagesize(16384) + self.reference_map.open(self.full_name, 'reference_map', db.DB_BTREE, + db.DB_CREATE|db.DB_AUTO_COMMIT, 0666) callback(37) @@ -356,7 +359,7 @@ class GrampsBSDDB(GrampsDbBase): db.DB_BTREE, flags=table_flags) self.reference_map_referenced_map = db.DB(self.env) - self.reference_map_referenced_map.set_flags(db.DB_DUP) + self.reference_map_referenced_map.set_flags(db.DB_DUP|db.DB_DUPSORT) self.reference_map_referenced_map.open(self.full_name, "reference_map_referenced_map", db.DB_BTREE, flags=table_flags) diff --git a/gramps2/src/GrampsDb/_ReadGedcom.py b/gramps2/src/GrampsDb/_ReadGedcom.py index 59c257125..dde54f0c4 100644 --- a/gramps2/src/GrampsDb/_ReadGedcom.py +++ b/gramps2/src/GrampsDb/_ReadGedcom.py @@ -670,10 +670,10 @@ class GedcomParser: if child: child.add_address(self.addr) self.db.commit_person(child, self.trans) - #if len(self.family.get_source_references()) == 0: - # sref = RelLib.SourceRef() - # sref.set_base_handle(self.def_src.get_handle()) - # self.family.add_source_reference(sref) + if len(self.family.get_source_references()) == 0: + sref = RelLib.SourceRef() + sref.set_base_handle(self.def_src.get_handle()) + self.family.add_source_reference(sref) self.db.commit_family(self.family, self.trans) del self.family elif matches[2] == "INDI": @@ -683,10 +683,10 @@ class GedcomParser: self.person = self.find_or_create_person(self.map_gid(gid)) self.added[self.person.get_handle()] = 1 self.parse_individual() - #if len(self.person.get_source_references()) == 0: - # sref = RelLib.SourceRef() - # sref.set_base_handle(self.def_src.get_handle()) - # self.person.add_source_reference(sref) + if len(self.person.get_source_references()) == 0: + sref = RelLib.SourceRef() + sref.set_base_handle(self.def_src.get_handle()) + self.person.add_source_reference(sref) self.db.commit_person(self.person, self.trans) del self.person elif matches[2] in ["SUBM","SUBN","REPO"]: