cabana: fix wrong file path handling for recent files menu (#32969)

fix lambda
old-commit-hash: e3e54fb28bad2e4848d9f3a510be8a45d9bd6ffa
This commit is contained in:
Dean Lee
2024-07-13 01:38:07 +08:00
committed by GitHub
parent 68fc530eca
commit 283574f334

View File

@@ -487,7 +487,7 @@ void MainWindow::updateRecentFileMenu() {
for (int i = 0; i < num_recent_files; ++i) {
QString text = tr("&%1 %2").arg(i + 1).arg(QFileInfo(settings.recent_files[i]).fileName());
open_recent_menu->addAction(text, this, [this, i=i](){ loadFile(settings.recent_files[i]); });
open_recent_menu->addAction(text, this, [this, file = settings.recent_files[i]]() { loadFile(file); });
}
}