mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-24 01:46:36 +02:00
fixed build errors
This commit is contained in:
parent
8130487b18
commit
f76c04b7a6
5 changed files with 69 additions and 148 deletions
|
@ -265,13 +265,5 @@ namespace i2p
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DaemonQT::init(int argc, char* argv[])
|
||||
{
|
||||
#if 0
|
||||
m_Impl = std::make_shared<DaemonQTImpl> (argc, argv);
|
||||
#endif
|
||||
return Daemon_Singleton::init(argc, argv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
10
Daemon.h
10
Daemon.h
|
@ -33,9 +33,6 @@ namespace i2p
|
|||
|
||||
#if defined(QT_GUI_LIB) // check if QT
|
||||
#define Daemon i2p::util::DaemonQT::Instance()
|
||||
#if 0
|
||||
class DaemonQTImpl;
|
||||
#endif
|
||||
class DaemonQT: public i2p::util::Daemon_Singleton
|
||||
{
|
||||
public:
|
||||
|
@ -47,13 +44,6 @@ namespace i2p
|
|||
}
|
||||
|
||||
bool init(int argc, char* argv[]);
|
||||
#if 0
|
||||
void run ();
|
||||
|
||||
private:
|
||||
|
||||
std::shared_ptr<DaemonQTImpl> m_Impl;
|
||||
#endif
|
||||
};
|
||||
|
||||
#elif defined(_WIN32)
|
||||
|
|
6
i2pd.cpp
6
i2pd.cpp
|
@ -17,7 +17,7 @@ int main( int argc, char* argv[] )
|
|||
//QMessageBox::information(0,"Debug","runGUI completed");
|
||||
QApplication app(argc, argv);
|
||||
qDebug("Initialising the daemon...");
|
||||
bool daemonInitSuccess = i2p::util::DaemonQt::DaemonQTImpl::init(argc, argv);
|
||||
bool daemonInitSuccess = i2p::qt::DaemonQTImpl::init(argc, argv);
|
||||
if(!daemonInitSuccess) {
|
||||
QMessageBox::critical(0, "Error", "Daemon init failed");
|
||||
return 1;
|
||||
|
@ -28,14 +28,14 @@ int main( int argc, char* argv[] )
|
|||
w.show ();
|
||||
int result;
|
||||
{
|
||||
i2p::util::DaemonQt::Controller daemonQtController;
|
||||
i2p::qt::Controller daemonQtController;
|
||||
qDebug("Starting the daemon...");
|
||||
emit daemonQtController.startDaemon();
|
||||
qDebug("Starting gui event loop...");
|
||||
result = app.exec();
|
||||
//QMessageBox::information(&w, "Debug", "exec finished");
|
||||
}
|
||||
i2p::util::DaemonQt::DaemonQTImpl::deinit();
|
||||
i2p::qt::DaemonQTImpl::deinit();
|
||||
//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");
|
||||
|
|
|
@ -7,7 +7,16 @@ namespace i2p
|
|||
{
|
||||
namespace util
|
||||
{
|
||||
namespace DaemonQt
|
||||
bool DaemonQT::init(int argc, char* argv[])
|
||||
{
|
||||
return Daemon_Singleton::init(argc, argv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
namespace qt
|
||||
{
|
||||
|
||||
void Worker::startDaemon() {
|
||||
|
@ -44,9 +53,9 @@ Controller::~Controller() {
|
|||
workerThread.quit();
|
||||
workerThread.wait();
|
||||
qDebug("Waiting for daemon worker thread finished.");
|
||||
if(i2p::util::DaemonQt::DaemonQTImpl::isRunning()) {
|
||||
if(DaemonQTImpl::isRunning()) {
|
||||
qDebug("Stopping the daemon...");
|
||||
i2p::util::DaemonQt::DaemonQTImpl::stop();
|
||||
DaemonQTImpl::stop();
|
||||
qDebug("Stopped the daemon.");
|
||||
}
|
||||
}
|
||||
|
@ -73,73 +82,6 @@ void DaemonQTImpl::setRunning(bool newValue){
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
#include <memory>
|
||||
#include "mainwindow.h"
|
||||
#include <QApplication>
|
||||
#include <stdlib.h>
|
||||
#include "../../Daemon.h"
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
class DaemonQTImpl: public std::enable_shared_from_this<DaemonQTImpl>
|
||||
{
|
||||
public:
|
||||
|
||||
DaemonQTImpl (int argc, char* argv[]):
|
||||
m_App (argc, argv)
|
||||
{
|
||||
}
|
||||
|
||||
void Run ()
|
||||
{
|
||||
MainWindow w(m_App);
|
||||
w.show ();
|
||||
m_App.exec();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void StartDaemon ()
|
||||
{
|
||||
Daemon.start ();
|
||||
}
|
||||
|
||||
void StopDaemon ()
|
||||
{
|
||||
Daemon.stop ();
|
||||
}
|
||||
|
||||
bool IsRunning () const
|
||||
{
|
||||
return Daemon.running;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
QApplication m_App;
|
||||
};
|
||||
|
||||
bool DaemonQT::init(int argc, char* argv[])
|
||||
{
|
||||
m_Impl = std::make_shared<DaemonQTImpl> (argc, argv);
|
||||
return Daemon_Singleton::init(argc, argv);
|
||||
}
|
||||
|
||||
void DaemonQT::run ()
|
||||
{
|
||||
if (m_Impl)
|
||||
{
|
||||
m_Impl->Run ();
|
||||
m_Impl = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -6,9 +6,7 @@
|
|||
|
||||
namespace i2p
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
namespace DaemonQt
|
||||
namespace qt
|
||||
{
|
||||
class Worker : public QObject
|
||||
{
|
||||
|
@ -61,6 +59,5 @@ namespace DaemonQt
|
|||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // DAEMONQT_H
|
||||
|
|
Loading…
Add table
Reference in a new issue