mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 12:55:31 +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())
|
CIdentifiable::CIdentifiable(QObject *object) : m_identifier(object->objectName())
|
||||||
{
|
{
|
||||||
// if the object name changes we update our originator
|
// 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);
|
QObject::disconnect(m_connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ namespace BlackMisc
|
|||||||
//! Get identifier
|
//! Get identifier
|
||||||
const CIdentifier &identifier() const { return m_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
|
//! Identifier with current timestamp
|
||||||
CIdentifier getCurrentTimestampIdentifier() const;
|
CIdentifier getCurrentTimestampIdentifier() const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user