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();
}
Пример #2
0
void PluginCollection::unloadAllPlugins() {
  for (QMap<QString, KstSharedPtr<Plugin> >::ConstIterator it = _plugins.begin();
                                                          it != _plugins.end();
                                                                         ++it) {
    emit pluginUnloaded(it.key());
  }

  _plugins.clear();
}
Пример #3
0
int PluginCollection::unloadPlugin(const KstSharedPtr<Plugin> p) {
  if (!p.data()) {
    return -1;
  }

  QString key = p->data()._name;
  _plugins.remove(key);

  emit pluginUnloaded(key);

  return 0;
}
Пример #4
0
        InstanceAdaptor::InstanceAdaptor(AbstractPlugin *p_plgn) : Adaptor(Core::instance ()) {
            if (p_plgn == NULL){
                emit pluginCantLoad (Core::arguments ()->value ("plugin").toString ());
                QApplication::quit ();
            } else {
                connect(QApplication::instance (),SIGNAL(aboutToQuit()),this,SIGNAL(aboutToQuit()));
                QDBusConnection::sessionBus ().connect ("org.thesii.Wintermute","/Factory",
                                                        "org.thesii.Wintermute.Factory","pluginCantLoad",
                                                        this,SIGNAL(pluginCantLoad(QString)));
                QDBusConnection::sessionBus ().connect ("org.thesii.Wintermute","/Factory",
                                                        "org.thesii.Wintermute.Factory","pluginLoaded",
                                                        this,SIGNAL(pluginLoaded(QString)));
                QDBusConnection::sessionBus ().connect ("org.thesii.Wintermute","/Factory",
                                                        "org.thesii.Wintermute.Factory","pluginUnloaded",
                                                        this,SIGNAL(pluginUnloaded(QString)));

                QDBusConnection::sessionBus ().connect ("org.thesii.Wintermute","/Factory",
                                                        "org.thesii.Wintermute.Factory","aboutToQuit",
                                                        this,SLOT(aboutToQuit()));

                setParent(p_plgn);
                //setAutoRelaySignals (true);
            }
        }
Пример #5
0
 void InstanceAdaptor::quit (const QDBusMessage& p_msg) const {
     const QString l_uuid = qobject_cast<AbstractPlugin*>(parent())->uuid();
     emit aboutToQuit ();
     qobject_cast<AbstractPlugin*>(parent())->doDeinitialize();
     emit pluginUnloaded (l_uuid);
 }