Slot OpenRecentFile in Tape replaced by lambda.
--HG-- branch : develop
This commit is contained in:
parent
7cabc7df18
commit
8b438daa6c
|
@ -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<QAction *>(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<QAction *>(sender()))
|
||||
{
|
||||
const QString filePath = action->data().toString();
|
||||
if (not filePath.isEmpty())
|
||||
{
|
||||
LoadFile(filePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool TMainWindow::IgnoreLocking(int error, const QString &path)
|
||||
{
|
||||
|
|
|
@ -75,7 +75,6 @@ private slots:
|
|||
void OpenStandard();
|
||||
void OpenTemplate();
|
||||
void CreateFromExisting();
|
||||
void OpenRecentFile();
|
||||
|
||||
void FileSave();
|
||||
void FileSaveAs();
|
||||
|
|
Loading…
Reference in New Issue
Block a user