2007-09-29 Benny Malengier <benny.malengier@gramps-project.org>

* src/GrampsDb/_ReadXML.py: remove bug: no more creation of objects if bookmark is found with
	handle that is not in database. This causes corruption of database!
	* src/GrampsDb/_GrampsDbBase.py: person bookmarks do not work after save. Correct. Issue #1260

	Part 1 of thumbnail changes


svn: r9038
This commit is contained in:
Benny Malengier 2007-09-29 12:19:23 +00:00
parent 56a231b7b6
commit 91f4d3c3be
3 changed files with 25 additions and 18 deletions

View File

@ -1,3 +1,8 @@
2007-09-29 Benny Malengier <benny.malengier@gramps-project.org>
* src/GrampsDb/_ReadXML.py: remove bug: no more creation of objects if bookmark is found with
handle that is not in database. This causes corruption of database!
* src/GrampsDb/_GrampsDbBase.py: person bookmarks do not work after save. Correct. Issue #1260
2007-09-28 James G. Sack <jgsack@san.rr.com> 2007-09-28 James G. Sack <jgsack@san.rr.com>
* src/GrampsDb/_GrampsDbBase.py: * src/GrampsDb/_GrampsDbBase.py:
0001187: Runaway Gramps XML file sizes 0001187: Runaway Gramps XML file sizes
@ -33,6 +38,7 @@
* src/ThumbNails.py: added rectangle parameter to thumbnail functions to specify the subsection * src/ThumbNails.py: added rectangle parameter to thumbnail functions to specify the subsection
* src/GrampsWidgets.py: added class MonitoredSpinButton * src/GrampsWidgets.py: added class MonitoredSpinButton
* src/glade/gramps.glade: added preview pixmap of subsection thumbnail to change_description * src/glade/gramps.glade: added preview pixmap of subsection thumbnail to change_description
Part 1 of thumbnail changes
2007-09-28 Zsolt Foldvari <zfoldvar@users.sourceforge.net> 2007-09-28 Zsolt Foldvari <zfoldvar@users.sourceforge.net>
* src/docgen/CairoDoc.py (fontstyle_to_fontdescription): Fix deprecated * src/docgen/CairoDoc.py (fontstyle_to_fontdescription): Fix deprecated

View File

@ -47,7 +47,6 @@ class GrampsXMLDB(GrampsInMemDB):
def __init__(self, use_txn = True): def __init__(self, use_txn = True):
"""creates a new GrampsDB""" """creates a new GrampsDB"""
GrampsInMemDB.__init__(self) GrampsInMemDB.__init__(self)
self.bookmarks = GrampsDbBookmarks()
def load(self, name, callback, mode="w"): def load(self, name, callback, mode="w"):
@ -67,7 +66,6 @@ class GrampsXMLDB(GrampsInMemDB):
except OSError, IOError: except OSError, IOError:
return 1 return 1
self.bookmarks.set(self.metadata.get('bookmarks',[]))
self.db_is_open = True self.db_is_open = True
self.abort_possible = True self.abort_possible = True
return 1 return 1

View File

@ -875,29 +875,32 @@ class GrampsParser(UpdateCallback):
# This is new XML, so we are guaranteed to have a handle ref # This is new XML, so we are guaranteed to have a handle ref
handle = attrs['hlink'].replace('_', '') handle = attrs['hlink'].replace('_', '')
# Due to pre 2.2.9 bug, bookmarks might be handle of other object
# Make sure those are filtered out.
# Bookmarks are at end, so all handle must exist before we do bookmrks
if target == 'person': if target == 'person':
self.db.check_person_from_handle(handle, self.trans) if self.db.find_person_from_handle(handle,self.trans) is not None:
self.db.bookmarks.append(handle) self.db.bookmarks.append(handle)
elif target == 'family': elif target == 'family':
self.db.check_family_from_handle(handle, self.trans) if self.db.find_family_from_handle(handle,self.trans) is not None:
self.db.family_bookmarks.append(handle) self.db.family_bookmarks.append(handle)
elif target == 'event': elif target == 'event':
self.db.check_event_from_handle(handle, self.trans) if self.db.find_event_from_handle(handle,self.trans) is not None:
self.db.event_bookmarks.append(handle) self.db.event_bookmarks.append(handle)
elif target == 'source': elif target == 'source':
self.db.check_source_from_handle(handle, self.trans) if self.db.find_source_from_handle(handle,self.trans) is not None:
self.db.source_bookmarks.append(handle) self.db.source_bookmarks.append(handle)
elif target == 'place': elif target == 'place':
self.db.check_place_from_handle(handle, self.trans) if self.db.find_place_from_handle(handle,self.trans) is not None:
self.db.place_bookmarks.append(handle) self.db.place_bookmarks.append(handle)
elif target == 'media': elif target == 'media':
self.db.check_object_from_handle(handle, self.trans) if self.db.find_object_from_handle(handle,self.trans) is not None:
self.db.media_bookmarks.append(handle) self.db.media_bookmarks.append(handle)
elif target == 'repository': elif target == 'repository':
self.db.check_repository_from_handle(handle, self.trans) if self.db.find_repository_from_handle(handle,self.trans) is not None:
self.db.repo_bookmarks.append(handle) self.db.repo_bookmarks.append(handle)
elif target == 'note': elif target == 'note':
self.db.check_note_from_handle(handle, self.trans) if self.db.find_note_from_handle(handle, self.trans) is not None:
self.db.note_bookmarks.append(handle) self.db.note_bookmarks.append(handle)
def start_format(self, attrs): def start_format(self, attrs):