mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
Ref T166, identifier can be set
(in case an identifier from a higher level should be set)
This commit is contained in:
@@ -21,9 +21,9 @@ namespace BlackMisc
|
||||
CIdentifiable::CIdentifiable(QObject *object) : m_identifier(object->objectName())
|
||||
{
|
||||
// if the object name changes we update our originator
|
||||
this->m_connection = QObject::connect(object, &QObject::objectNameChanged, [this, object]()
|
||||
m_connection = QObject::connect(object, &QObject::objectNameChanged, [this, object]()
|
||||
{
|
||||
this->m_identifier = CIdentifier(object->objectName());
|
||||
m_identifier = CIdentifier(object->objectName());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -31,5 +31,4 @@ namespace BlackMisc
|
||||
{
|
||||
QObject::disconnect(m_connection);
|
||||
}
|
||||
|
||||
} // ns
|
||||
|
||||
@@ -32,6 +32,9 @@ namespace BlackMisc
|
||||
//! Get identifier
|
||||
const CIdentifier &identifier() const { return m_identifier; }
|
||||
|
||||
//! Set identifier, allows to set an external identifier
|
||||
void setIdentifier(const CIdentifier &identifier) { m_identifier = identifier; }
|
||||
|
||||
//! Identifier with current timestamp
|
||||
CIdentifier getCurrentTimestampIdentifier() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user