Remove missing files from the recent files list when scanning it for world info. xxxx maybe not the right place for this...

This commit is contained in:
David Vierra 2015-04-15 00:31:19 -10:00
parent 3c4336e487
commit c0910ddfd0

View File

@ -267,8 +267,11 @@ class WorldListWidget(QtGui.QDialog):
self.accept()
self.editWorldClicked.emit(f)
return triggered
dead = []
for filename in recentWorlds:
if not os.path.exists(filename):
dead.append(filename)
continue
try:
displayName, lastPlayed = getWorldInfo(filename)
action = self.recentWorldsMenu.addAction(displayName)
@ -277,6 +280,11 @@ class WorldListWidget(QtGui.QDialog):
except EnvironmentError as e:
log.exception("Failed to load world info")
if len(dead):
for f in dead:
recentWorlds.remove(f)
RecentFilesSetting.setValue(recentWorlds)
self.recentWorldsButton.setMenu(self.recentWorldsMenu)
def reloadList(self):