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()]
|
||||
Utils.modified()
|
||||
|
||||
for p in self.db.getPersonMap().values():
|
||||
for key in self.db.getPersonKeys():
|
||||
key = self.db.getPerson(key)
|
||||
nl = []
|
||||
change = 0
|
||||
for photo in p.getPhotoList():
|
||||
@ -750,7 +751,8 @@ class DeleteMediaQuery:
|
||||
if change:
|
||||
p.setPhotoList(nl)
|
||||
|
||||
for p in self.db.getSourceMap().values():
|
||||
for key in self.db.getSourceKeys():
|
||||
p = self.db.getSource(key)
|
||||
nl = []
|
||||
change = 0
|
||||
for photo in p.getPhotoList():
|
||||
@ -761,7 +763,8 @@ class DeleteMediaQuery:
|
||||
if change:
|
||||
p.setPhotoList(nl)
|
||||
|
||||
for p in self.db.getPlaceMap().values():
|
||||
for key in self.db.getPlaceKeys():
|
||||
p = self.db.getPlace(key)
|
||||
nl = []
|
||||
change = 0
|
||||
for photo in p.getPhotoList():
|
||||
|
@ -234,15 +234,18 @@ class MediaView:
|
||||
for o in p.getPhotoList():
|
||||
if o.getReference() == mobj:
|
||||
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():
|
||||
if o.getReference() == mobj:
|
||||
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():
|
||||
if o.getReference() == mobj:
|
||||
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():
|
||||
if o.getReference() == mobj:
|
||||
return 1
|
||||
|
@ -840,7 +840,8 @@ class MergePlaces:
|
||||
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():
|
||||
if event.getPlace() == self.p2:
|
||||
event.setPlace(self.p1)
|
||||
|
@ -123,7 +123,8 @@ class SelectChild:
|
||||
slist.append(c)
|
||||
|
||||
person_list = []
|
||||
for person in self.db.getPersonMap().values():
|
||||
for key in self.db.getPersonKeys():
|
||||
person = self.db.getPerson(key)
|
||||
if filter:
|
||||
if person in slist or person.getMainParents():
|
||||
continue
|
||||
|
@ -134,11 +134,13 @@ class SourceView:
|
||||
self.update(0)
|
||||
|
||||
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():
|
||||
if sref.getBase() == source:
|
||||
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 sref in v.getSourceRefList():
|
||||
if sref.getBase() == source:
|
||||
|
Loading…
Reference in New Issue
Block a user