From 5811a68714c3300c7a77031646f57806b325e935 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 2 Aug 2006 04:29:46 +0000 Subject: [PATCH] * src/RelLib/_Place.py: Check for empty location * src/Editors/_EditEvent.py: use default data change check svn: r7111 --- gramps2/ChangeLog | 2 ++ gramps2/src/Editors/_EditEvent.py | 9 --------- gramps2/src/RelLib/_Place.py | 5 ++++- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index f1d79fb42..434099eb4 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,6 @@ 2006-08-01 Don Allingham + * src/RelLib/_Place.py: Check for empty location + * src/Editors/_EditEvent.py: use default data change check * src/DataViews/_PersonView.py: use grouping name * src/NameDisplay.py: Add grouping from data instead of just Name instance, handle Name.DEF diff --git a/gramps2/src/Editors/_EditEvent.py b/gramps2/src/Editors/_EditEvent.py index 2d0781bae..fc3606a18 100644 --- a/gramps2/src/Editors/_EditEvent.py +++ b/gramps2/src/Editors/_EditEvent.py @@ -221,15 +221,6 @@ class EditEvent(EditPrimary): self.callback(self.obj) self.close() - def data_has_changed(self): - if self.db.readonly: - return False - elif self.obj.handle: - orig = self.db.get_event_from_handle(self.obj.handle) - return cmp(orig.serialize(),self.obj.serialize()) != 0 - else: - return True - class EditPersonEvent(EditEvent): def __init__(self, event, dbstate, uistate, track=[], callback=None): diff --git a/gramps2/src/RelLib/_Place.py b/gramps2/src/RelLib/_Place.py index e8a94031e..3af915cfe 100644 --- a/gramps2/src/RelLib/_Place.py +++ b/gramps2/src/RelLib/_Place.py @@ -36,6 +36,8 @@ from _MediaBase import MediaBase from _UrlBase import UrlBase from _Location import Location +_EMPTY_LOC = Location().serialize() + #------------------------------------------------------------------------- # # Place class @@ -89,7 +91,8 @@ class Place(PrimaryObject,SourceBase,NoteBase,MediaBase,UrlBase): be considered persistent. @rtype: tuple """ - if self.main_loc == None: + + if self.main_loc == None or self.main_loc.serialize() == _EMPTY_LOC: main_loc = None else: main_loc = self.main_loc.serialize()