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

View File

@@ -19,7 +19,7 @@
#include "blackcore/blackcoreexport.h"
#include "blackcore/context/contextapplication.h"
#include "blackcore/corefacadeconfig.h"
#include "blackmisc/identifier.h"
#include "blackmisc/identifiable.h"
#include "blackmisc/identifierlist.h"
#include "blackmisc/statusmessage.h"
#include "blackmisc/valuecache.h"
@@ -36,7 +36,9 @@ namespace BlackCore
namespace 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_OBJECT

View File

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