Ref T413, application context "identifable"

This commit is contained in:
Klaus Basan
2018-10-28 13:21:19 +01:00
parent eeabbf6e39
commit 75d57b4afa
3 changed files with 12 additions and 5 deletions

View File

@@ -30,7 +30,7 @@ namespace BlackCore
namespace Context namespace Context
{ {
CContextApplication::CContextApplication(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : CContextApplication::CContextApplication(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) :
IContextApplication(mode, runtime) IContextApplication(mode, runtime), CIdentifiable(this)
{ } { }
CContextApplication *CContextApplication::registerWithDBus(BlackMisc::CDBusServer *server) CContextApplication *CContextApplication::registerWithDBus(BlackMisc::CDBusServer *server)
@@ -209,8 +209,7 @@ namespace BlackCore
CIdentifier CContextApplication::getApplicationIdentifier() const CIdentifier CContextApplication::getApplicationIdentifier() const
{ {
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; } if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
static const CIdentifier identifier("swift application"); return this->identifier();
return identifier;
} }
QString CContextApplication::readFromFile(const QString &fileName) const QString CContextApplication::readFromFile(const QString &fileName) const

View File

@@ -19,7 +19,7 @@
#include "blackcore/blackcoreexport.h" #include "blackcore/blackcoreexport.h"
#include "blackcore/context/contextapplication.h" #include "blackcore/context/contextapplication.h"
#include "blackcore/corefacadeconfig.h" #include "blackcore/corefacadeconfig.h"
#include "blackmisc/identifier.h" #include "blackmisc/identifiable.h"
#include "blackmisc/identifierlist.h" #include "blackmisc/identifierlist.h"
#include "blackmisc/statusmessage.h" #include "blackmisc/statusmessage.h"
#include "blackmisc/valuecache.h" #include "blackmisc/valuecache.h"
@@ -36,7 +36,9 @@ namespace BlackCore
namespace Context namespace Context
{ {
//! Application context //! Application context
class BLACKCORE_EXPORT CContextApplication : public IContextApplication class BLACKCORE_EXPORT CContextApplication :
public IContextApplication,
public BlackMisc::CIdentifiable
{ {
Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTAPPLICATION_INTERFACENAME) Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTAPPLICATION_INTERFACENAME)
Q_OBJECT Q_OBJECT

View File

@@ -51,6 +51,12 @@ namespace BlackMisc
//! Destructor //! Destructor
~CIdentifiable(); ~CIdentifiable();
//! Copy constructor
CIdentifiable(const CIdentifiable &) = default;
//! Copy assignment operator
CIdentifiable &operator =(const CIdentifiable &) = default;
private: private:
CIdentifier m_identifier; CIdentifier m_identifier;
QMetaObject::Connection m_connection; QMetaObject::Connection m_connection;