Better looping control
svn: r1028
This commit is contained in:
parent
aed5a10637
commit
b023868cfc
@ -728,7 +728,8 @@ class DeleteMediaQuery:
|
|||||||
del self.db.getObjectMap()[self.media.getId()]
|
del self.db.getObjectMap()[self.media.getId()]
|
||||||
Utils.modified()
|
Utils.modified()
|
||||||
|
|
||||||
for p in self.db.getPersonMap().values():
|
for key in self.db.getPersonKeys():
|
||||||
|
key = self.db.getPerson(key)
|
||||||
nl = []
|
nl = []
|
||||||
change = 0
|
change = 0
|
||||||
for photo in p.getPhotoList():
|
for photo in p.getPhotoList():
|
||||||
@ -750,7 +751,8 @@ class DeleteMediaQuery:
|
|||||||
if change:
|
if change:
|
||||||
p.setPhotoList(nl)
|
p.setPhotoList(nl)
|
||||||
|
|
||||||
for p in self.db.getSourceMap().values():
|
for key in self.db.getSourceKeys():
|
||||||
|
p = self.db.getSource(key)
|
||||||
nl = []
|
nl = []
|
||||||
change = 0
|
change = 0
|
||||||
for photo in p.getPhotoList():
|
for photo in p.getPhotoList():
|
||||||
@ -761,7 +763,8 @@ class DeleteMediaQuery:
|
|||||||
if change:
|
if change:
|
||||||
p.setPhotoList(nl)
|
p.setPhotoList(nl)
|
||||||
|
|
||||||
for p in self.db.getPlaceMap().values():
|
for key in self.db.getPlaceKeys():
|
||||||
|
p = self.db.getPlace(key)
|
||||||
nl = []
|
nl = []
|
||||||
change = 0
|
change = 0
|
||||||
for photo in p.getPhotoList():
|
for photo in p.getPhotoList():
|
||||||
|
@ -234,15 +234,18 @@ class MediaView:
|
|||||||
for o in p.getPhotoList():
|
for o in p.getPhotoList():
|
||||||
if o.getReference() == mobj:
|
if o.getReference() == mobj:
|
||||||
return 1
|
return 1
|
||||||
for p in self.db.getPersonMap().values():
|
for key in self.db.getPersonKeys():
|
||||||
|
p = self.db.getPerson(key)
|
||||||
for o in p.getPhotoList():
|
for o in p.getPhotoList():
|
||||||
if o.getReference() == mobj:
|
if o.getReference() == mobj:
|
||||||
return 1
|
return 1
|
||||||
for p in self.db.getSourceMap().values():
|
for key in self.db.getSourceKeys()
|
||||||
|
p = self.db.getSource(key)
|
||||||
for o in p.getPhotoList():
|
for o in p.getPhotoList():
|
||||||
if o.getReference() == mobj:
|
if o.getReference() == mobj:
|
||||||
return 1
|
return 1
|
||||||
for p in self.db.getPlaceMap().values():
|
for key in self.db.getPlaceKeys():
|
||||||
|
p = self.db.getPlace(key)
|
||||||
for o in p.getPhotoList():
|
for o in p.getPhotoList():
|
||||||
if o.getReference() == mobj:
|
if o.getReference() == mobj:
|
||||||
return 1
|
return 1
|
||||||
|
@ -840,7 +840,8 @@ class MergePlaces:
|
|||||||
self.p1.add_alternate_locations(l)
|
self.p1.add_alternate_locations(l)
|
||||||
|
|
||||||
|
|
||||||
for p in self.db.getPersonMap().values():
|
for key in self.db.getPersonKeys():
|
||||||
|
p = self.db.getPerson(key)
|
||||||
for event in [p.getBirth(), p.getDeath()] + p.getEventList():
|
for event in [p.getBirth(), p.getDeath()] + p.getEventList():
|
||||||
if event.getPlace() == self.p2:
|
if event.getPlace() == self.p2:
|
||||||
event.setPlace(self.p1)
|
event.setPlace(self.p1)
|
||||||
|
@ -123,7 +123,8 @@ class SelectChild:
|
|||||||
slist.append(c)
|
slist.append(c)
|
||||||
|
|
||||||
person_list = []
|
person_list = []
|
||||||
for person in self.db.getPersonMap().values():
|
for key in self.db.getPersonKeys():
|
||||||
|
person = self.db.getPerson(key)
|
||||||
if filter:
|
if filter:
|
||||||
if person in slist or person.getMainParents():
|
if person in slist or person.getMainParents():
|
||||||
continue
|
continue
|
||||||
|
@ -134,11 +134,13 @@ class SourceView:
|
|||||||
self.update(0)
|
self.update(0)
|
||||||
|
|
||||||
def is_source_used(self,source):
|
def is_source_used(self,source):
|
||||||
for p in self.db.getPlaceMap().values():
|
for key in self.db.getPlaceKeys():
|
||||||
|
p = self.db.getPlace(key)
|
||||||
for sref in p.getSourceRefList():
|
for sref in p.getSourceRefList():
|
||||||
if sref.getBase() == source:
|
if sref.getBase() == source:
|
||||||
return 1
|
return 1
|
||||||
for p in self.db.getPersonMap().values():
|
for key in self.db.getPersonKeys():
|
||||||
|
p = self.db.getPerson(key)
|
||||||
for v in p.getEventList() + [p.getBirth(), p.getDeath()]:
|
for v in p.getEventList() + [p.getBirth(), p.getDeath()]:
|
||||||
for sref in v.getSourceRefList():
|
for sref in v.getSourceRefList():
|
||||||
if sref.getBase() == source:
|
if sref.getBase() == source:
|
||||||
|
Loading…
Reference in New Issue
Block a user