IdentityModel::~IdentityModel() { disconnect(IdentityManager::instance(), SIGNAL(identityAboutToBeAdded(Identity)), this, SLOT(identityAboutToBeAdded(Identity))); disconnect(IdentityManager::instance(), SIGNAL(identityAdded(Identity)), this, SLOT(identityAdded(Identity))); disconnect(IdentityManager::instance(), SIGNAL(identityAboutToBeRemoved(Identity)), this, SLOT(identityAboutToBeRemoved(Identity))); disconnect(IdentityManager::instance(), SIGNAL(identityRemoved(Identity)), this, SLOT(identityRemoved(Identity))); }
IdentityModel::IdentityModel(QObject *parent) : QAbstractListModel(parent) { connect(IdentityManager::instance(), SIGNAL(identityAboutToBeAdded(Identity)), this, SLOT(identityAboutToBeAdded(Identity))); connect(IdentityManager::instance(), SIGNAL(identityAdded(Identity)), this, SLOT(identityAdded(Identity))); connect(IdentityManager::instance(), SIGNAL(identityAboutToBeRemoved(Identity)), this, SLOT(identityAboutToBeRemoved(Identity))); connect(IdentityManager::instance(), SIGNAL(identityRemoved(Identity)), this, SLOT(identityRemoved(Identity))); }
void IdentityModel::init() { connect( m_identityManager, SIGNAL(identityAboutToBeAdded(Identity)), this, SLOT(identityAboutToBeAdded(Identity)), Qt::DirectConnection); connect( m_identityManager, SIGNAL(identityAdded(Identity)), this, SLOT(identityAdded(Identity)), Qt::DirectConnection); connect( m_identityManager, SIGNAL(identityAboutToBeRemoved(Identity)), this, SLOT(identityAboutToBeRemoved(Identity)), Qt::DirectConnection); connect( m_identityManager, SIGNAL(identityRemoved(Identity)), this, SLOT(identityRemoved(Identity)), Qt::DirectConnection); }