Remove redundant check.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-12-21 17:19:12 +02:00
parent ffc1bae39c
commit 4cf9c59056

View File

@ -637,18 +637,15 @@ bool VApplication::event(QEvent *e)
case QEvent::FileOpen: case QEvent::FileOpen:
{ {
QFileOpenEvent *fileOpenEvent = static_cast<QFileOpenEvent *>(e); QFileOpenEvent *fileOpenEvent = static_cast<QFileOpenEvent *>(e);
if(fileOpenEvent) const QString macFileOpen = fileOpenEvent->file();
if(not macFileOpen.isEmpty())
{ {
const QString macFileOpen = fileOpenEvent->file(); MainWindow *window = qobject_cast<MainWindow*>(mainWindow);
if(not macFileOpen.isEmpty()) if (window)
{ {
MainWindow *window = qobject_cast<MainWindow*>(mainWindow); window->LoadPattern(macFileOpen); // open file in existing window
if (window)
{
window->LoadPattern(macFileOpen); // open file in existing window
}
return true;
} }
return true;
} }
break; break;
} }