xref: /glogg/src/gloggapp.cpp (revision ba1adacf449b6b453b28c1fbb461891062ffc725)
1*ba1adacfSNicolas Bonnefon /*
2*ba1adacfSNicolas Bonnefon  * Copyright (C) 2017 Nicolas Bonnefon and other contributors
3*ba1adacfSNicolas Bonnefon  *
4*ba1adacfSNicolas Bonnefon  * This file is part of glogg.
5*ba1adacfSNicolas Bonnefon  *
6*ba1adacfSNicolas Bonnefon  * glogg is free software: you can redistribute it and/or modify
7*ba1adacfSNicolas Bonnefon  * it under the terms of the GNU General Public License as published by
8*ba1adacfSNicolas Bonnefon  * the Free Software Foundation, either version 3 of the License, or
9*ba1adacfSNicolas Bonnefon  * (at your option) any later version.
10*ba1adacfSNicolas Bonnefon  *
11*ba1adacfSNicolas Bonnefon  * glogg is distributed in the hope that it will be useful,
12*ba1adacfSNicolas Bonnefon  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13*ba1adacfSNicolas Bonnefon  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*ba1adacfSNicolas Bonnefon  * GNU General Public License for more details.
15*ba1adacfSNicolas Bonnefon  *
16*ba1adacfSNicolas Bonnefon  * You should have received a copy of the GNU General Public License
17*ba1adacfSNicolas Bonnefon  * along with glogg.  If not, see <http://www.gnu.org/licenses/>.
18*ba1adacfSNicolas Bonnefon  */
19*ba1adacfSNicolas Bonnefon 
20*ba1adacfSNicolas Bonnefon #include "gloggapp.h"
21*ba1adacfSNicolas Bonnefon 
22*ba1adacfSNicolas Bonnefon #include <QFileOpenEvent>
23*ba1adacfSNicolas Bonnefon 
24*ba1adacfSNicolas Bonnefon #ifdef __APPLE__
event(QEvent * event)25*ba1adacfSNicolas Bonnefon bool GloggApp::event( QEvent *event )
26*ba1adacfSNicolas Bonnefon {
27*ba1adacfSNicolas Bonnefon     if (event->type() == QEvent::FileOpen) {
28*ba1adacfSNicolas Bonnefon         QFileOpenEvent *openEvent = static_cast<QFileOpenEvent *>(event);
29*ba1adacfSNicolas Bonnefon         emit loadFile( openEvent->file() );
30*ba1adacfSNicolas Bonnefon     }
31*ba1adacfSNicolas Bonnefon 
32*ba1adacfSNicolas Bonnefon     return QApplication::event(event);
33*ba1adacfSNicolas Bonnefon }
34*ba1adacfSNicolas Bonnefon #endif
35