Fix recent files menu only opening the last world in the menu (oops)
This commit is contained in:
parent
c28f8b9e75
commit
e0878cee26
@ -469,17 +469,21 @@ class MCEditApp(QtGui.QApplication):
|
|||||||
displayFilenames = []
|
displayFilenames = []
|
||||||
for text, path in filenames:
|
for text, path in filenames:
|
||||||
if displayNames[text] > 1:
|
if displayNames[text] > 1:
|
||||||
text = text + " (%s)" % path
|
text += " (%s)" % path
|
||||||
displayFilenames.append((text, path))
|
displayFilenames.append((text, path))
|
||||||
|
|
||||||
for text, path in displayFilenames:
|
for text, path in displayFilenames:
|
||||||
log.info("Adding %s", text)
|
log.info("Adding %s", text)
|
||||||
action = recentWorldsMenu.addAction(text)
|
action = recentWorldsMenu.addAction(text)
|
||||||
def _triggered():
|
|
||||||
self.loadFile(filename)
|
|
||||||
|
|
||||||
action.triggered.connect(_triggered)
|
def _triggered(p):
|
||||||
action.__triggered = _triggered
|
def _f():
|
||||||
|
self.loadFile(p)
|
||||||
|
return _f
|
||||||
|
|
||||||
|
triggered = _triggered(path)
|
||||||
|
action.triggered.connect(triggered)
|
||||||
|
action.__triggered = triggered
|
||||||
|
|
||||||
def addRecentFile(self, filename):
|
def addRecentFile(self, filename):
|
||||||
recentFiles = RecentFilesSetting.jsonValue([])
|
recentFiles = RecentFilesSetting.jsonValue([])
|
||||||
|
Reference in New Issue
Block a user