Speed up Place Reference Editor and Listview for enclose place
Fixes #11531
This commit is contained in:
parent
cc7c0a3f13
commit
7d6113cf38
@ -51,6 +51,7 @@ class EditPlaceRef(EditReference):
|
|||||||
def __init__(self, state, uistate, track, place, place_ref, update):
|
def __init__(self, state, uistate, track, place, place_ref, update):
|
||||||
EditReference.__init__(self, state, uistate, track, place, place_ref,
|
EditReference.__init__(self, state, uistate, track, place, place_ref,
|
||||||
update)
|
update)
|
||||||
|
self.original = place.serialize()
|
||||||
|
|
||||||
def _local_init(self):
|
def _local_init(self):
|
||||||
|
|
||||||
@ -312,8 +313,10 @@ class EditPlaceRef(EditReference):
|
|||||||
return
|
return
|
||||||
|
|
||||||
if self.source.handle:
|
if self.source.handle:
|
||||||
with DbTxn(_("Modify Place"), self.db) as trans:
|
# only commit if it has changed
|
||||||
self.db.commit_place(self.source, trans)
|
if self.source.serialize() != self.original:
|
||||||
|
with DbTxn(_("Modify Place"), self.db) as trans:
|
||||||
|
self.db.commit_place(self.source, trans)
|
||||||
else:
|
else:
|
||||||
if self.check_for_duplicate_id('Place'):
|
if self.check_for_duplicate_id('Place'):
|
||||||
return
|
return
|
||||||
|
@ -846,6 +846,9 @@ class ListView(NavigationView):
|
|||||||
for cl_name, handle in self.dbstate.db.find_backlink_handles(hndl):
|
for cl_name, handle in self.dbstate.db.find_backlink_handles(hndl):
|
||||||
if cl_name == nav_type:
|
if cl_name == nav_type:
|
||||||
upd_list.append(handle)
|
upd_list.append(handle)
|
||||||
|
if len(upd_list) > 20:
|
||||||
|
self.dirty = True
|
||||||
|
return
|
||||||
if (cl_name == 'Place' or cl_name == 'Event' and
|
if (cl_name == 'Place' or cl_name == 'Event' and
|
||||||
nav_type == 'Person'):
|
nav_type == 'Person'):
|
||||||
queue.append(handle)
|
queue.append(handle)
|
||||||
|
Loading…
Reference in New Issue
Block a user