1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

Mac: Fix opening urls from FileOpen event

This commit is contained in:
David Rosca 2016-09-04 15:42:51 +02:00
parent d4facf2806
commit 35657e6005

View File

@ -1124,9 +1124,17 @@ RegisterQAppAssociation* MainApplication::associationManager()
bool MainApplication::event(QEvent* e)
{
switch (e->type()) {
case QEvent::FileOpen:
addNewTab(QUrl::fromLocalFile(static_cast<QFileOpenEvent*>(e)->file()));
case QEvent::FileOpen: {
QFileOpenEvent *ev = static_cast<QFileOpenEvent*>(e);
if (!ev->url().isEmpty()) {
addNewTab(ev->url());
} else if (!ev->file().isEmpty()) {
addNewTab(QUrl::fromLocalFile(ev->file()));
} else {
return false;
}
return true;
}
case QEvent::ApplicationActivate:
if (!activeWindow() && m_windows.isEmpty())