mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 11:05:33 +08:00
Ref T384, strip added name before adding a changed one
This commit is contained in:
@@ -86,6 +86,9 @@ namespace BlackMisc
|
||||
void CIdentifier::appendName(const QString &name)
|
||||
{
|
||||
if (m_name.endsWith(name)) { return; }
|
||||
if (name.isEmpty()) { return; }
|
||||
const int index = m_name.lastIndexOf(':');
|
||||
if (index >= 0) { m_name = m_name.left(index); }
|
||||
m_name += QStringLiteral(":") + name;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ namespace BlackMisc
|
||||
CIdentifier(const QString &name);
|
||||
|
||||
//! Constructor using object's name
|
||||
//! \remark automatically changes if object's name changes
|
||||
CIdentifier(const QString &name, QObject *object);
|
||||
|
||||
//! Returns an anonymous identifier, which is a valid identifier without name
|
||||
|
||||
Reference in New Issue
Block a user