mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
committed by
Mathew Sutcliffe
parent
34774bd005
commit
1f2a88e502
42
src/blackcore/coreruntime.cpp
Normal file
42
src/blackcore/coreruntime.cpp
Normal file
@@ -0,0 +1,42 @@
|
||||
#include "blackcore/coreruntime.h"
|
||||
#include "blackmisc/blackmiscfreefunctions.h"
|
||||
#include "blackmisc/nwserver.h"
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
/*
|
||||
* Constructor
|
||||
*/
|
||||
CCoreRuntime::CCoreRuntime(bool withDbus, QObject *parent) :
|
||||
QObject(parent), m_init(false), m_dbusServer(nullptr), m_contextNetwork(nullptr), m_settings(nullptr)
|
||||
{
|
||||
this->init(withDbus);
|
||||
}
|
||||
|
||||
/*
|
||||
* Init runtime
|
||||
*/
|
||||
void CCoreRuntime::init(bool withDbus)
|
||||
{
|
||||
if (m_init) return;
|
||||
BlackMisc::registerMetadata();
|
||||
BlackMisc::initResources();
|
||||
|
||||
// TODO: read settings
|
||||
if (withDbus)
|
||||
{
|
||||
QString dBusAddress = "session";
|
||||
this->m_dbusServer = new CDBusServer(dBusAddress, this);
|
||||
}
|
||||
|
||||
// contexts
|
||||
this->m_settings = new CContextSettings(this);
|
||||
if (withDbus) this->m_settings->registerWithDBus(this->m_dbusServer);
|
||||
|
||||
this->m_contextNetwork = new CContextNetwork(this);
|
||||
if (withDbus) this->m_contextNetwork->registerWithDBus(this->m_dbusServer); // complete object after init
|
||||
|
||||
// flag
|
||||
m_init = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user