|
|
@ -28,12 +28,14 @@ |
|
|
|
* Contact : chris@qbittorrent.org |
|
|
|
* Contact : chris@qbittorrent.org |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <QEvent> |
|
|
|
#include <QFileOpenEvent> |
|
|
|
#include <QFileOpenEvent> |
|
|
|
#include "qmacapplication.h" |
|
|
|
#include "qmacapplication.h" |
|
|
|
|
|
|
|
|
|
|
|
QMacApplication::QMacApplication(QString appid, int &argc, char** argv) : |
|
|
|
QMacApplication::QMacApplication(QString appid, int &argc, char** argv) : |
|
|
|
QtSingleApplication(appid, argc, argv) |
|
|
|
QtSingleApplication(appid, argc, argv) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
qDebug("Constructing a QMacApplication to receive file open events"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool QMacApplication::event(QEvent * ev) { |
|
|
|
bool QMacApplication::event(QEvent * ev) { |
|
|
@ -41,6 +43,7 @@ bool QMacApplication::event(QEvent * ev) { |
|
|
|
case QEvent::FileOpen: |
|
|
|
case QEvent::FileOpen: |
|
|
|
{ |
|
|
|
{ |
|
|
|
QString path = static_cast<QFileOpenEvent *>(ev)->file(); |
|
|
|
QString path = static_cast<QFileOpenEvent *>(ev)->file(); |
|
|
|
|
|
|
|
qDebug("Received a mac file open event: %s", qPrintable(path)); |
|
|
|
emit newFileOpenMacEvent(path); |
|
|
|
emit newFileOpenMacEvent(path); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|