Fix recent files menu only opening the last world in the menu (oops)

This commit is contained in:
David Vierra 2015-03-18 17:07:18 -10:00
parent c28f8b9e75
commit e0878cee26

View File

@ -469,17 +469,21 @@ class MCEditApp(QtGui.QApplication):
displayFilenames = []
for text, path in filenames:
if displayNames[text] > 1:
text = text + " (%s)" % path
text += " (%s)" % path
displayFilenames.append((text, path))
for text, path in displayFilenames:
log.info("Adding %s", text)
action = recentWorldsMenu.addAction(text)
def _triggered():
self.loadFile(filename)
action.triggered.connect(_triggered)
action.__triggered = _triggered
def _triggered(p):
def _f():
self.loadFile(p)
return _f
triggered = _triggered(path)
action.triggered.connect(triggered)
action.__triggered = triggered
def addRecentFile(self, filename):
recentFiles = RecentFilesSetting.jsonValue([])