|
|
@ -78,11 +78,6 @@ namespace qt |
|
|
|
setRunningCallback(0); |
|
|
|
setRunningCallback(0); |
|
|
|
m_IsRunning=false; |
|
|
|
m_IsRunning=false; |
|
|
|
return Daemon.init(argc,argv); |
|
|
|
return Daemon.init(argc,argv); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void DaemonQTImpl::deinit() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
delete mutex; mutex = nullptr; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void DaemonQTImpl::start() |
|
|
|
void DaemonQTImpl::start() |
|
|
@ -129,9 +124,10 @@ namespace qt |
|
|
|
|
|
|
|
|
|
|
|
int RunQT (int argc, char* argv[]) |
|
|
|
int RunQT (int argc, char* argv[]) |
|
|
|
{ |
|
|
|
{ |
|
|
|
//int result = runGUI(argc, argv);
|
|
|
|
|
|
|
|
//QMessageBox::information(0,"Debug","runGUI completed");
|
|
|
|
|
|
|
|
QApplication app(argc, argv); |
|
|
|
QApplication app(argc, argv); |
|
|
|
|
|
|
|
int result; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
DaemonQTImpl daemon; |
|
|
|
DaemonQTImpl daemon; |
|
|
|
qDebug("Initialising the daemon..."); |
|
|
|
qDebug("Initialising the daemon..."); |
|
|
|
bool daemonInitSuccess = daemon.init(argc, argv); |
|
|
|
bool daemonInitSuccess = daemon.init(argc, argv); |
|
|
@ -144,19 +140,19 @@ namespace qt |
|
|
|
MainWindow w; |
|
|
|
MainWindow w; |
|
|
|
qDebug("Before main window.show()..."); |
|
|
|
qDebug("Before main window.show()..."); |
|
|
|
w.show (); |
|
|
|
w.show (); |
|
|
|
int result; |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
/* i2p::qt::Controller daemonQtController(daemon);
|
|
|
|
i2p::qt::Controller daemonQtController(daemon); |
|
|
|
qDebug("Starting the daemon..."); |
|
|
|
qDebug("Starting the daemon..."); |
|
|
|
emit daemonQtController.startDaemon(); |
|
|
|
emit daemonQtController.startDaemon(); |
|
|
|
qDebug("Starting gui event loop...");*/ |
|
|
|
//daemon.start ();
|
|
|
|
daemon.start (); |
|
|
|
qDebug("Starting GUI event loop..."); |
|
|
|
result = app.exec(); |
|
|
|
result = app.exec(); |
|
|
|
daemon.stop (); |
|
|
|
//daemon.stop ();
|
|
|
|
} |
|
|
|
} |
|
|
|
daemon.deinit(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//QMessageBox::information(&w, "Debug", "demon stopped");
|
|
|
|
//QMessageBox::information(&w, "Debug", "demon stopped");
|
|
|
|
//exit(result); //return from main() causes intermittent sigsegv bugs in some Androids. exit() is a workaround for this
|
|
|
|
|
|
|
|
qDebug("Exiting the application"); |
|
|
|
qDebug("Exiting the application"); |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|