From b0190ded972b2d0abae552d2a8c561633ea44e4a Mon Sep 17 00:00:00 2001 From: NeoTheFox Date: Mon, 23 Mar 2015 14:28:18 +0300 Subject: [PATCH] Made dirty hack less dirty --- mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 47c1b40..2be18e6 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -619,7 +619,6 @@ void MainWindow::updateRecent() { QAction *action = new QAction(this); action->setText(str); //Set filepath as a title - action->setObjectName(str); //Also set name to the path so we can get it later recentMenu->addAction(action); //Add action to the menu connect(action, &QAction::triggered, this, &MainWindow::recentClicked); } @@ -953,5 +952,6 @@ void MainWindow::recentClicked() //Actually a dirty hack, but it is fast and simple //So this slot is not for anything to trigger, but //recent files menu - parseFile(sender()->objectName()); + QAction *action = qobject_cast(sender()); + if(action) parseFile(action->text()); }