diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index cfae1b38e..a0b5e2d67 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -1743,7 +1743,17 @@ void TMainWindow::SetupMenu() for (int i = 0; i < MaxRecentFiles; ++i) { recentFileActs[i] = new QAction(this); - connect(recentFileActs[i], &QAction::triggered, this, &TMainWindow::OpenRecentFile); + connect(recentFileActs[i], &QAction::triggered, this, [this]() + { + if (auto action = qobject_cast(sender())) + { + const QString filePath = action->data().toString(); + if (not filePath.isEmpty()) + { + LoadFile(filePath); + } + } + }); ui->menuFile->insertAction(ui->actionPreferences, recentFileActs[i]); recentFileActs[i]->setVisible(false); } @@ -2778,19 +2788,6 @@ void TMainWindow::CreateWindowMenu(QMenu *menu) } } -//--------------------------------------------------------------------------------------------------------------------- -void TMainWindow::OpenRecentFile() -{ - if (auto action=qobject_cast(sender())) - { - const QString filePath = action->data().toString(); - if (not filePath.isEmpty()) - { - LoadFile(filePath); - } - } -} - //--------------------------------------------------------------------------------------------------------------------- bool TMainWindow::IgnoreLocking(int error, const QString &path) { diff --git a/src/app/tape/tmainwindow.h b/src/app/tape/tmainwindow.h index c7dff2a39..80683d98f 100644 --- a/src/app/tape/tmainwindow.h +++ b/src/app/tape/tmainwindow.h @@ -75,7 +75,6 @@ private slots: void OpenStandard(); void OpenTemplate(); void CreateFromExisting(); - void OpenRecentFile(); void FileSave(); void FileSaveAs();