From df5cf255dee55209683a1ac43b8b63a6d9526239 Mon Sep 17 00:00:00 2001 From: Javier Serrano Polo Date: Mon, 20 Mar 2017 02:07:21 +0000 Subject: [PATCH] Update MainApplication.cpp (#3440) Drop useless condition. --- src/gui/MainApplication.cpp | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/gui/MainApplication.cpp b/src/gui/MainApplication.cpp index 425b026f1..d31cf3058 100644 --- a/src/gui/MainApplication.cpp +++ b/src/gui/MainApplication.cpp @@ -42,25 +42,21 @@ bool MainApplication::event(QEvent* event) case QEvent::FileOpen: { QFileOpenEvent * fileEvent = static_cast(event); - if(event) + // Handle the project file + m_queuedFile = fileEvent->file(); + if(Engine::getSong()) { - // Handle the project file - m_queuedFile = fileEvent->file(); - if(Engine::getSong()) + if(gui->mainWindow()->mayChangeProject(true)) { - if(gui->mainWindow()->mayChangeProject(true)) - { - qDebug() << "Loading file " << m_queuedFile; - Engine::getSong()->loadProject(m_queuedFile); - } + qDebug() << "Loading file " << m_queuedFile; + Engine::getSong()->loadProject(m_queuedFile); } - else - { - qDebug() << "Queuing file " << m_queuedFile; - } - return true; } - // Fall through to default + else + { + qDebug() << "Queuing file " << m_queuedFile; + } + return true; } default: return QApplication::event(event);