Kopete::ChatSession::ChatSession( const Kopete::Contact *user, Kopete::ContactPtrList others, Kopete::Protocol *protocol, Kopete::ChatSession::Form form ) : QObject( user->account()) { d = new KMMPrivate; d->mUser = user; d->mProtocol = protocol; d->isEmpty = others.isEmpty(); d->mCanBeDeleted = true; d->refcount = 0; d->view = 0L; d->customDisplayName = false; d->mayInvite = false; d->form = form; d->warnGroupChat = true; if ( !others.isEmpty() ) { d->lastUrl = initLastUrl( others.first() ); } for ( int i = 0; others.size() != i; ++i ) addContact( others[i], true ); connect( Kopete::PluginManager::self(), SIGNAL(pluginLoaded(Kopete::Plugin*)), this, SLOT(clearChains()) ); connect( Kopete::PluginManager::self(), SIGNAL(pluginUnloaded(QString)), this, SLOT(clearChains()) ); connect( user, SIGNAL(contactDestroyed(Kopete::Contact*)), this, SLOT(slotMyselfDestroyed(Kopete::Contact*)) ); connect( user, SIGNAL(onlineStatusChanged(Kopete::Contact*,Kopete::OnlineStatus,Kopete::OnlineStatus)), this, SLOT(slotOnlineStatusChanged(Kopete::Contact*,Kopete::OnlineStatus,Kopete::OnlineStatus)) ); if( user->metaContact() ) connect( user->metaContact(), SIGNAL(photoChanged()), this, SIGNAL(photoChanged()) ); slotUpdateDisplayName(); }
Kopete::ChatSession::ChatSession( const Kopete::Contact *user, Kopete::ContactPtrList others, Kopete::Protocol *protocol, const char *name ) : QObject( user->account(), name ) { d = new KMMPrivate; d->mUser = user; d->mProtocol = protocol; d->isEmpty = others.isEmpty(); d->mCanBeDeleted = true; d->refcount = 0; d->view = 0L; d->customDisplayName = false; d->mayInvite = false; for ( Kopete::Contact *c = others.first(); c; c = others.next() ) addContact( c, true ); connect( user, SIGNAL( onlineStatusChanged( Kopete::Contact *, const Kopete::OnlineStatus &, const Kopete::OnlineStatus & ) ), this, SLOT( slotOnlineStatusChanged( Kopete::Contact *, const Kopete::OnlineStatus &, const Kopete::OnlineStatus & ) ) ); if( user->metaContact() ) connect( user->metaContact(), SIGNAL( photoChanged() ), this, SIGNAL( photoChanged() ) ); slotUpdateDisplayName(); }
void Kopete::ChatSession::addContact( const Kopete::Contact *c, bool suppress ) { //kdDebug( 14010 ) << k_funcinfo << endl; if ( d->mContactList.contains( c ) ) { kdDebug( 14010 ) << k_funcinfo << "Contact already exists" <<endl; emit contactAdded( c, suppress ); } else { if ( d->mContactList.count() == 1 && d->isEmpty ) { kdDebug( 14010 ) << k_funcinfo << " F****R ZONE " << endl; /* We have only 1 contact before, so the status of the message manager was given from that contact status */ Kopete::Contact *old = d->mContactList.first(); d->mContactList.remove( old ); d->mContactList.append( c ); disconnect( old, SIGNAL( onlineStatusChanged( Kopete::Contact *, const Kopete::OnlineStatus &, const Kopete::OnlineStatus & ) ), this, SLOT( slotOnlineStatusChanged( Kopete::Contact *, const Kopete::OnlineStatus &, const Kopete::OnlineStatus &) ) ); if ( old->metaContact() ) { disconnect( old->metaContact(), SIGNAL( displayNameChanged( const QString &, const QString & ) ), this, SLOT( slotUpdateDisplayName() ) ); disconnect( old->metaContact(), SIGNAL( photoChanged() ), this, SIGNAL( photoChanged() ) ); } else
void Config::setPhoto(const QString &str) { qDebug() << Q_FUNC_INFO << str; d->mData["photo"] = QVariant(str); d->mSettings->setValue("photo", d->mData["photo"].toString()); Q_EMIT photoChanged(); }
void UserProfile::setPhoto(QImage &photo) { if (m_photo != photo) { m_photo = photo; emit photoChanged(); } }
void PhotoLoader::handleReply(AbstractProcessor *processor) { Q_D(PhotoLoader); ObjectProcessor *objectProcessor = qobject_cast<ObjectProcessor *>(processor); if (d->photo) { d->photo->deleteLater(); } d->photo = qobject_cast<Photo*>(objectProcessor->object()); d->photo->setParent(this); emit photoChanged(); }
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 {