-
Notifications
You must be signed in to change notification settings - Fork 0
/
browbeaterapplication.cpp
48 lines (38 loc) · 1.21 KB
/
browbeaterapplication.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "browbeaterapplication.h"
#include "platform_interface.hpp"
#include <QFileOpenEvent>
#include <iostream>
#ifdef Q_QDOC
BrowBeaterApplication::BrowBeaterApplication(int &argc, char **argv)
: QApplication(argc,argv)
#else
BrowBeaterApplication::BrowBeaterApplication(int &argc, char **argv, int applicationFlags /* = ApplicationFlags */)
: QApplication(argc,argv,applicationFlags)
#endif
{
// connectOs(*this);
}
BrowBeaterApplication::~BrowBeaterApplication()
{
// disconnectOs(*this);
}
bool BrowBeaterApplication::event(QFileOpenEvent *theEvent)
{
std::string url = theEvent->url().toString().toStdString();
if (url.length()) {
std::vector< std::string const > urls;
urls.push_back(url);
if (urls.size()) {
mainWindow.set_urls(urls);
mainWindow.show();
}
}
return QApplication::event(theEvent);
}
bool BrowBeaterApplication::event(QEvent *theEvent)
{
if (theEvent->type() == QEvent::FileOpen) {
return event(static_cast<QFileOpenEvent *>(theEvent));
}
return QApplication::event(theEvent);
}