[Bugfix] Remove elements of shrinking list!

This commit is contained in:
Ludger Küperkoch 2021-01-14 14:04:50 +01:00
parent a9784d33e5
commit 172786dc6d

View File

@ -1297,13 +1297,17 @@ class MainWindow(QMainWindow):
return False
else:
info_str = ''
new_eventlist = []
i = 0
for event, path_exists in zip(self.project.eventlist, paths_exist):
if not path_exists:
info_str += '\n{} exists: {}'.format(event.path, path_exists)
del self.project.eventlist[i]
else:
i += 1
new_eventlist.append(self.project.eventlist[i])
i += 1
if len(new_eventlist) > 0:
# adopt changes in event listings
self.project.eventlist = new_eventlist
print('Unable to find certain event paths:{}'.format(info_str))
print("Removed these event paths from project eventlist!")
return True