2016-06-14 02:52:17 +02:00
|
|
|
#include "mainwindow.h"
|
|
|
|
#include <QApplication>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "../../Daemon.h"
|
|
|
|
|
2016-06-15 16:17:02 +02:00
|
|
|
class DaemonQT: public i2p::util::Daemon_Singleton
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
static DaemonQT& Instance()
|
|
|
|
{
|
|
|
|
static DaemonQT instance;
|
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-06-14 02:52:17 +02:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
QApplication a(argc, argv);
|
|
|
|
MainWindow w;
|
|
|
|
|
2016-06-15 15:31:52 +02:00
|
|
|
int ret = -1;
|
2016-06-15 16:17:02 +02:00
|
|
|
if (DaemonQT::Instance ().init(argc, argv))
|
2016-06-14 02:52:17 +02:00
|
|
|
{
|
2016-06-15 16:17:02 +02:00
|
|
|
if (DaemonQT::Instance ().start())
|
2016-06-15 15:31:52 +02:00
|
|
|
{
|
|
|
|
w.show();
|
|
|
|
ret = a.exec();
|
|
|
|
}
|
2016-06-15 16:17:02 +02:00
|
|
|
DaemonQT::Instance ().stop();
|
2016-06-14 02:52:17 +02:00
|
|
|
}
|
|
|
|
|
2016-06-15 15:31:52 +02:00
|
|
|
return ret;
|
2016-06-14 02:52:17 +02:00
|
|
|
}
|