From f0bceec6ea2e9011482a804b3109717e4c9cf92b Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 30 May 2017 20:09:34 +0300 Subject: [PATCH] Cppcheck warning. --HG-- branch : develop --- src/app/valentina/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 0db695b9c..f54847b52 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -3989,9 +3989,9 @@ void MainWindow::CreateActions() QAction *action = new QAction(this); action->setVisible(false); recentFileActs[i] = action; - connect(recentFileActs[i], &QAction::triggered, this, [action, this]() + connect(recentFileActs[i], &QAction::triggered, this, [this]() { - if (action != nullptr) + if (QAction *action = qobject_cast(sender())) { const QString filePath = action->data().toString(); if (not filePath.isEmpty())