Changed to astyle format and added comment

This commit is contained in:
Klaus Basan
2014-01-13 13:26:30 +01:00
parent 11666da76a
commit 959f171edf
2 changed files with 170 additions and 146 deletions

View File

@@ -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;
}
} }

View File

@@ -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