From 2a7a35a25922f004a681ec11e46a79b509b58513 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 9 May 2006 04:15:04 +0000 Subject: [PATCH] 2006-05-08 Don Allingham * src/GrampsDb/_GrampsDbBase.py: get_default_handle() * src/DisplayState.py: use get_default_handle, fix race condition svn: r6591 --- ChangeLog | 4 ++++ src/DisplayState.py | 2 +- src/GrampsDb/_GrampsDbBase.py | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7352c89a2..8418ea5cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-05-08 Don Allingham + * src/GrampsDb/_GrampsDbBase.py: get_default_handle() + * src/DisplayState.py: use get_default_handle, fix race condition + 2006-05-08 Alex Roitman * src/GrampsDb/_GrampsBSDDB.py (load): Better non-TXN support. * src/UndoHistory.py (__init__): Rename list to tree. diff --git a/src/DisplayState.py b/src/DisplayState.py index 64d614838..2f6f81c87 100644 --- a/src/DisplayState.py +++ b/src/DisplayState.py @@ -329,7 +329,7 @@ class DisplayState(GrampsDb.GrampsDBCallback): pname = NameDisplay.displayer.display(person) name = "[%s] %s" % (person.get_gramps_id(),pname) if Config.get(Config.STATUSBAR) > 1: - if person.handle != self.dbstate.db.get_default_person().handle: + if person.handle != self.dbstate.db.get_default_handle(): msg = self.display_relationship() if msg: name = "%s (%s)" % (name,msg) diff --git a/src/GrampsDb/_GrampsDbBase.py b/src/GrampsDb/_GrampsDbBase.py index adfe1675d..8b403f028 100644 --- a/src/GrampsDb/_GrampsDbBase.py +++ b/src/GrampsDb/_GrampsDbBase.py @@ -1530,6 +1530,12 @@ class GrampsDbBase(GrampsDBCallback): return None return None + def get_default_handle(self): + """returns the default Person of the database""" + if self.metadata: + return self.metadata.get('default') + return None + def get_save_path(self): """returns the save path of the file, or "" if one does not exist""" return self.path