mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Mac: Fix opening urls from FileOpen event
This commit is contained in:
parent
d4facf2806
commit
35657e6005
@ -1124,9 +1124,17 @@ RegisterQAppAssociation* MainApplication::associationManager()
|
|||||||
bool MainApplication::event(QEvent* e)
|
bool MainApplication::event(QEvent* e)
|
||||||
{
|
{
|
||||||
switch (e->type()) {
|
switch (e->type()) {
|
||||||
case QEvent::FileOpen:
|
case QEvent::FileOpen: {
|
||||||
addNewTab(QUrl::fromLocalFile(static_cast<QFileOpenEvent*>(e)->file()));
|
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;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
case QEvent::ApplicationActivate:
|
case QEvent::ApplicationActivate:
|
||||||
if (!activeWindow() && m_windows.isEmpty())
|
if (!activeWindow() && m_windows.isEmpty())
|
||||||
|
Loading…
Reference in New Issue
Block a user