mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 18:55:38 +08:00
Changed to astyle format and added comment
This commit is contained in:
@@ -8,29 +8,28 @@
|
|||||||
|
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
CCoreRuntime::CCoreRuntime(bool withDbus, QObject *parent) :
|
CCoreRuntime::CCoreRuntime(bool withDbus, QObject *parent) :
|
||||||
QObject(parent), m_init(false), m_dbusServer(nullptr),
|
QObject(parent), m_init(false), m_dbusServer(nullptr),
|
||||||
m_contextNetwork(nullptr), m_contextVoice(nullptr),
|
m_contextNetwork(nullptr), m_contextVoice(nullptr),
|
||||||
m_contextSettings(nullptr), m_contextApplication(nullptr)
|
m_contextSettings(nullptr), m_contextApplication(nullptr)
|
||||||
{
|
{
|
||||||
this->init(withDbus);
|
this->init(withDbus);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Init runtime
|
* Init runtime
|
||||||
*/
|
*/
|
||||||
void CCoreRuntime::init(bool withDbus)
|
void CCoreRuntime::init(bool withDbus)
|
||||||
{
|
{
|
||||||
if (m_init) return;
|
if (m_init) return;
|
||||||
BlackMisc::registerMetadata();
|
BlackMisc::registerMetadata();
|
||||||
BlackMisc::initResources();
|
BlackMisc::initResources();
|
||||||
|
|
||||||
// TODO: read settings
|
// TODO: read settings
|
||||||
if (withDbus)
|
if (withDbus) {
|
||||||
{
|
|
||||||
QString dBusAddress = "session";
|
QString dBusAddress = "session";
|
||||||
this->m_dbusServer = new CDBusServer(dBusAddress, this);
|
this->m_dbusServer = new CDBusServer(dBusAddress, this);
|
||||||
}
|
}
|
||||||
@@ -50,21 +49,45 @@ namespace BlackCore
|
|||||||
|
|
||||||
// flag
|
// flag
|
||||||
m_init = true;
|
m_init = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
IContextNetwork *CCoreRuntime::getIContextNetwork() { return this->m_contextNetwork; }
|
IContextNetwork *CCoreRuntime::getIContextNetwork()
|
||||||
|
{
|
||||||
const IContextNetwork *CCoreRuntime::getIContextNetwork() const { return this->m_contextNetwork; }
|
return this->m_contextNetwork;
|
||||||
|
}
|
||||||
IContextVoice *CCoreRuntime::getIContextVoice() { return this->m_contextVoice; }
|
|
||||||
|
const IContextNetwork *CCoreRuntime::getIContextNetwork() const
|
||||||
const IContextVoice *CCoreRuntime::getIContextVoice() const { return this->m_contextVoice; }
|
{
|
||||||
|
return this->m_contextNetwork;
|
||||||
IContextSettings *CCoreRuntime::getIContextSettings() { return this->m_contextSettings; }
|
}
|
||||||
|
|
||||||
const IContextSettings *CCoreRuntime::getIContextSettings() const { return this->m_contextSettings; }
|
IContextVoice *CCoreRuntime::getIContextVoice()
|
||||||
|
{
|
||||||
const IContextApplication *CCoreRuntime::getIContextApplication() const { return this->m_contextApplication; }
|
return this->m_contextVoice;
|
||||||
|
}
|
||||||
IContextApplication *CCoreRuntime::getIContextApplication() { return this->m_contextApplication; }
|
|
||||||
|
const IContextVoice *CCoreRuntime::getIContextVoice() const
|
||||||
|
{
|
||||||
|
return this->m_contextVoice;
|
||||||
|
}
|
||||||
|
|
||||||
|
IContextSettings *CCoreRuntime::getIContextSettings()
|
||||||
|
{
|
||||||
|
return this->m_contextSettings;
|
||||||
|
}
|
||||||
|
|
||||||
|
const IContextSettings *CCoreRuntime::getIContextSettings() const
|
||||||
|
{
|
||||||
|
return this->m_contextSettings;
|
||||||
|
}
|
||||||
|
|
||||||
|
const IContextApplication *CCoreRuntime::getIContextApplication() const
|
||||||
|
{
|
||||||
|
return this->m_contextApplication;
|
||||||
|
}
|
||||||
|
|
||||||
|
IContextApplication *CCoreRuntime::getIContextApplication()
|
||||||
|
{
|
||||||
|
return this->m_contextApplication;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,24 +5,26 @@
|
|||||||
|
|
||||||
namespace BlackCore
|
namespace BlackCore
|
||||||
{
|
{
|
||||||
class CDBusServer;
|
// forward declaration, see review
|
||||||
class CContextNetwork;
|
// https://dev.vatsim-germany.org/boards/22/topics/1350?r=1359#message-1359
|
||||||
class CContextVoice;
|
class CDBusServer;
|
||||||
class CContextSettings;
|
class CContextNetwork;
|
||||||
class CContextApplication;
|
class CContextVoice;
|
||||||
class IContextNetwork;
|
class CContextSettings;
|
||||||
class IContextVoice;
|
class CContextApplication;
|
||||||
class IContextSettings;
|
class IContextNetwork;
|
||||||
class IContextApplication;
|
class IContextVoice;
|
||||||
|
class IContextSettings;
|
||||||
|
class IContextApplication;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief The CCoreRuntime class
|
* \brief The CCoreRuntime class
|
||||||
*/
|
*/
|
||||||
class CCoreRuntime : public QObject
|
class CCoreRuntime : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_init; /*!< flag */
|
bool m_init; /*!< flag */
|
||||||
CDBusServer *m_dbusServer;
|
CDBusServer *m_dbusServer;
|
||||||
CContextNetwork *m_contextNetwork;
|
CContextNetwork *m_contextNetwork;
|
||||||
@@ -36,7 +38,7 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
void init(bool withDbus);
|
void init(bool withDbus);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*!
|
/*!
|
||||||
* \brief Constructor
|
* \brief Constructor
|
||||||
* \param withDbus
|
* \param withDbus
|
||||||
@@ -53,8 +55,7 @@ namespace BlackCore
|
|||||||
* \brief DBus server
|
* \brief DBus server
|
||||||
* \return
|
* \return
|
||||||
*/
|
*/
|
||||||
const CDBusServer *getDBusServer() const
|
const CDBusServer *getDBusServer() const {
|
||||||
{
|
|
||||||
return this->m_dbusServer;
|
return this->m_dbusServer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,6 +108,6 @@ namespace BlackCore
|
|||||||
*/
|
*/
|
||||||
IContextApplication *getIContextApplication();
|
IContextApplication *getIContextApplication();
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif // guard
|
#endif // guard
|
||||||
|
|||||||
Reference in New Issue
Block a user