Esempio n. 1
0
	SearchModel::SearchModel(QObject *parent)
		: AbstractSearchModel(parent)
		, SearchRequested_(false)
	{
		connect(Ui::GetDispatcher(), SIGNAL(searchResult(QStringList)), this, SLOT(searchResult(QStringList)), Qt::QueuedConnection);
        connect(GetAvatarStorage(), SIGNAL(avatarChanged(QString)), this, SLOT(avatarLoaded(QString)), Qt::QueuedConnection);
        connect(Ui::GetDispatcher(), SIGNAL(contactRemoved(QString)), this, SLOT(contactRemoved(QString)), Qt::QueuedConnection);
	}
Esempio n. 2
0
BuddyContactModel::BuddyContactModel(Buddy buddy, QObject *parent) :
		QAbstractListModel(parent), SourceBuddy(buddy), IncludeIdentityInDisplay(false)
{
	connect(SourceBuddy, SIGNAL(contactAboutToBeAdded(Contact)),
			this, SLOT(contactAboutToBeAdded(Contact)), Qt::DirectConnection);
	connect(SourceBuddy, SIGNAL(contactAdded(Contact)),
			this, SLOT(contactAdded(Contact)), Qt::DirectConnection);
	connect(SourceBuddy, SIGNAL(contactAboutToBeRemoved(Contact)),
			this, SLOT(contactAboutToBeRemoved(Contact)), Qt::DirectConnection);
	connect(SourceBuddy, SIGNAL(contactRemoved(Contact)),
			this, SLOT(contactRemoved(Contact)), Qt::DirectConnection);
}
Esempio n. 3
0
void ContactManager::removeContact(Contact contact)
{
	kdebugf();
	if (contact.isNull())
		return;

	ensureLoaded();

	if (!Contacts.contains(contact))
		return;

	disconnect(contact.data(), SIGNAL(updated()), this, SLOT(contactDataUpdated()));
	disconnect(contact.data(), SIGNAL(accountDataAboutToBeAdded(Account *)),
			this, SLOT(contactAccountDataAboutToBeAdded(Account *)));
	disconnect(contact.data(), SIGNAL(accountDataAdded(Account *)),
			this, SLOT(contactAccountDataAdded(Account *)));
	disconnect(contact.data(), SIGNAL(accountDataAboutToBeRemoved(Account *)),
			this, SLOT(contactAccountDataAboutToBeRemoved(Account *)));
	disconnect(contact.data(), SIGNAL(accountDataRemoved(Account *)),
			this, SLOT(contactAccountDataRemoved(Account *)));
	disconnect(contact.data(), SIGNAL(accountDataIdChanged(Account *, const QString &)),
			this, SLOT(contactAccountDataIdChanged(Account *, const QString &)));

	emit contactAboutToBeRemoved(contact);
	if (ContactRemovePredicateObject::inquireAll(contact))
	{
		Contacts.removeAll(contact);
		contact.removeFromStorage();
	}
	emit contactRemoved(contact);
	contact.setType(ContactData::TypeAnonymous);

	kdebugf();
}
Esempio n. 4
0
GaduRosterService::GaduRosterService(GaduListHelper *gaduListHelper, const QVector<Contact> &contacts, Protocol *protocol) :
		RosterService{contacts, protocol},
		m_stateMachine{new GaduRosterStateMachine{this, protocol}},
		m_gaduListHelper{gaduListHelper}
{
	connect(this, SIGNAL(contactAdded(Contact)), this, SLOT(rosterChanged()));
	connect(this, SIGNAL(contactRemoved(Contact)), this, SLOT(rosterChanged()));
	connect(this, SIGNAL(contactUpdatedLocally(Contact)), this, SLOT(rosterChanged()));

	connect(m_stateMachine, SIGNAL(performGet()), SLOT(importContactList()));
	connect(m_stateMachine, SIGNAL(performPut()), SLOT(exportContactList()));
}
SeasidePerson::~SeasidePerson()
{
    SeasideCache::unregisterResolveListener(this);

    emit contactRemoved();

    if (mAttachState == Unattached) {
        delete mContact;
    } else if (mAttachState == Listening) {
        mItem->removeListener(this);
    }
}
Esempio n. 6
0
bool SSIManager::removeContact( const Oscar::SSI& contact )
{
    QString contactName = contact.name();
    int remcount = d->SSIList.remove( contact );
    removeID( contact );

    if ( remcount == 0 )
    {
        kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "No contacts were removed." << endl;
        return false;
    }

    emit contactRemoved( contactName );
    return true;
}
Esempio n. 7
0
void ContactModel::addBot(MAGNORMOBOT *bot)
{
	if (conduits.contains(bot)) {
		qWarning("ContactModel is already tracking %p\n", bot);
		return;
	}
	connect(bot, SIGNAL(contactPresenceUpdated(QString)), SLOT(updateContactPresence(QString)));
    connect(bot, SIGNAL(contactAdded(QString)), SLOT(addContact(QString)));
    connect(bot, SIGNAL(contactUpdated(QString)), SLOT(updateContact(QString)));
    connect(bot, SIGNAL(contactRemoved(QString)), SLOT(removeContact(QString)));
	connect(bot, SIGNAL(contactListReceived()), SLOT(receiveContactList()));
	connect(bot, SIGNAL(disconnected()), SLOT(botDisconnected()), Qt::QueuedConnection);
	connect(bot, SIGNAL(destroyed()), SLOT(botDestroyed()));
    refreshContacts(bot);
}
void Kopete::ChatSession::addContact( const Kopete::Contact *c, bool suppress )
{
	//kDebug( 14010 ) ;
	if ( d->contacts.contains( (Kopete::Contact*)c ) )
	{
		kDebug( 14010 ) << "Contact already exists";
//		emit contactAdded( c, suppress );
	}
	else
	{
		if ( d->contacts.count() == 1 && d->isEmpty )
		{
			kDebug( 14010 ) << " F****R ZONE ";
			/* We have only 1 contact before, so the status of the
			   message manager was given from that contact status */
			Kopete::Contact *old = d->contacts.first();
			d->contacts.removeAll( old );
			d->contacts.append( (Kopete::Contact*)c );

			disconnect( old, SIGNAL(onlineStatusChanged(Kopete::Contact*,Kopete::OnlineStatus,Kopete::OnlineStatus)),
				this, SLOT(slotOnlineStatusChanged(Kopete::Contact*,Kopete::OnlineStatus,Kopete::OnlineStatus)) );
			disconnect( old, SIGNAL(statusMessageChanged(Kopete::Contact*)), this, SIGNAL(statusMessageChanged(Kopete::Contact*)) );

			if ( old->metaContact() )
			{
				disconnect( old->metaContact(), SIGNAL(displayNameChanged(QString,QString)), this, SLOT(slotUpdateDisplayName()) );
				disconnect( old->metaContact(), SIGNAL(photoChanged()), this, SIGNAL(photoChanged()) );
			}
			else
				disconnect( old, SIGNAL(propertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)), this, SLOT(slotUpdateDisplayName()) );

			disconnect( old, SIGNAL(propertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)), this, SLOT(slotContactPropertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)) );

			emit contactAdded( c, suppress );
			emit contactRemoved( old, QString() );
		}
		else
		{
Esempio n. 9
0
SeasidePerson::~SeasidePerson()
{
    emit contactRemoved();
}
Esempio n. 10
0
void BuddiesAwareObject::triggerAllBuddiesRemoved()
{
	foreach (const Buddy &buddy, BuddyManager::instance()->items())
		contactRemoved(buddy);
}
Esempio n. 11
0
void GaduProtocol::init()
{
    Connection = new ProtocolGaduConnection(this);
    Connection->setConnectionProtocol(this);

    m_gaduAccountAvatarService = new GaduAccountAvatarService(account(), this);

    CurrentChatImageService = new GaduChatImageService(account(), this);
    CurrentChatImageService->setConnection(Connection);

    CurrentImTokenService = new GaduIMTokenService{this};

    CurrentFileTransferService = pluginInjectedFactory()->makeInjected<GaduFileTransferService>(this);
    CurrentFileTransferService->setGaduIMTokenService(CurrentImTokenService);

    CurrentChatService = pluginInjectedFactory()->makeInjected<GaduChatService>(account(), this);
    CurrentChatService->setConnection(Connection);
    CurrentChatService->setGaduChatImageService(CurrentChatImageService);
    CurrentChatService->setGaduFileTransferService(CurrentFileTransferService);
    CurrentChatImageService->setGaduChatService(CurrentChatService);

    CurrentContactPersonalInfoService =
        pluginInjectedFactory()->makeInjected<GaduContactPersonalInfoService>(account(), this);
    CurrentContactPersonalInfoService->setConnection(Connection);

    CurrentPersonalInfoService = pluginInjectedFactory()->makeInjected<GaduPersonalInfoService>(account(), this);
    CurrentPersonalInfoService->setConnection(Connection);

    CurrentSearchService = pluginInjectedFactory()->makeInjected<GaduSearchService>(account(), this);
    CurrentSearchService->setConnection(Connection);

    CurrentMultilogonService = new GaduMultilogonService(account(), this);
    CurrentMultilogonService->setConnection(Connection);

    CurrentChatStateService = pluginInjectedFactory()->makeInjected<GaduChatStateService>(account(), this);
    CurrentChatStateService->setConnection(Connection);

    m_gaduContactAvatarService = pluginInjectedFactory()->makeInjected<GaduContactAvatarService>(account(), this);

    connect(
        CurrentChatService, SIGNAL(messageReceived(Message)), CurrentChatStateService, SLOT(messageReceived(Message)));

    CurrentDriveService = pluginInjectedFactory()->makeInjected<GaduDriveService>(account(), this);
    CurrentDriveService->setGaduIMTokenService(CurrentImTokenService);

    CurrentUserDataService =
        pluginInjectedFactory()->makeInjected<GaduUserDataService>(m_gaduContactAvatarService, account(), this);

    auto contacts = contactManager()->contacts(account(), ContactManager::ExcludeAnonymous);
    auto rosterService = pluginInjectedFactory()->makeInjected<GaduRosterService>(m_gaduListHelper, contacts, this);
    rosterService->setConnection(Connection);

    CurrentNotifyService = new GaduNotifyService{Connection, this};
    connect(rosterService, SIGNAL(contactAdded(Contact)), CurrentNotifyService, SLOT(contactAdded(Contact)));
    connect(rosterService, SIGNAL(contactRemoved(Contact)), CurrentNotifyService, SLOT(contactRemoved(Contact)));
    connect(
        rosterService, SIGNAL(contactUpdatedLocally(Contact)), CurrentNotifyService,
        SLOT(contactUpdatedLocally(Contact)));

    setRosterService(rosterService);

    configureServices();

    connect(account(), SIGNAL(updated()), this, SLOT(accountUpdated()));

    OpenChatRunner = m_pluginInjectedFactory->makeInjected<GaduOpenChatWithRunner>(account());
    OpenChatWithRunnerManager::instance()->registerRunner(OpenChatRunner);

    m_aggregatedAccountAvatarService->add(m_gaduAccountAvatarService);
    m_aggregatedContactAvatarService->add(m_gaduContactAvatarService);
    m_chatServiceRepository->addChatService(CurrentChatService);
    m_chatStateServiceRepository->addChatStateService(CurrentChatStateService);
}
Esempio n. 12
0
void ContactsAwareObject::triggerAllContactsRemoved()
{
	foreach (Contact contact, ContactManager::instance()->contacts())
		contactRemoved(contact);
}