* src/RelLib/_Place.py: Check for empty location

* src/Editors/_EditEvent.py: use default data change check


svn: r7111
This commit is contained in:
Don Allingham 2006-08-02 04:29:46 +00:00
parent b301aa401f
commit 5811a68714
3 changed files with 6 additions and 10 deletions

View File

@ -1,4 +1,6 @@
2006-08-01 Don Allingham <don@gramps-project.org>
* 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

View File

@ -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):

View File

@ -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()