コード例 #1
0
ファイル: jaccount.cpp プロジェクト: akahan/qutim
void JAccount::loadSettings()
{
	Q_D(JAccount);
	Config cfg = config();
	cfg.beginGroup("general");

	d->priority = cfg.value("priority", 15);
	d->nick = cfg.value("nick", id());
	if (cfg.hasChildKey("photoHash"))
		setAvatarHex(cfg.value("photoHash", QString()));

	Jreen::JID jid(id());
	if (!d->client->isConnected()) {
		jid.setResource(cfg.value("resource", QLatin1String("qutIM/Jreen")));
	}
	{
		cfg.beginGroup("bosh");
		if (cfg.value("use", false)) {
			QString host = cfg.value("host", jid.domain());
			int port = cfg.value("port", 5280);
			d->client->setConnection(new ConnectionBOSH(host, port));
		}
		cfg.endGroup();
	}
	d->client->setJID(jid);
	d->client->setPassword(cfg.value("passwd", QString(), Config::Crypted));
	if(!cfg.value("autoDetect",true)) {
		d->client->setPort(cfg.value("port", 5222));
		d->client->setServer(cfg.value("server",d->client->server()));
	}

	cfg.endGroup();
	
	emit parametersChanged(d->parameters);
}
コード例 #2
0
ファイル: jaccount.cpp プロジェクト: ranjan0013/qutim
void JAccount::loadSettings()
{
	Q_D(JAccount);
	Config cfg = config();
	cfg.beginGroup("general");

	d->priority = cfg.value("priority", 15);
	d->nick = cfg.value("nick", id());
	if (cfg.hasChildKey("photoHash"))
		setAvatarHex(cfg.value("photoHash", QString()));
//	d->pgpKeyId = cfg.value("pgpKeyId", QString());

	Jreen::JID jid(id());
	if (!d->client->isConnected()) {
		jid.setResource(cfg.value("resource", QLatin1String("qutIM")));
	}
	d->client->setFeatureConfig(Client::Encryption, cfg.value("encryption", Client::Auto));
	d->client->setFeatureConfig(Client::Compression, cfg.value("compression", Client::Auto));
	{
		cfg.beginGroup("bosh");
		if (cfg.value("use", false)) {
			QString host = cfg.value("host", jid.domain());
			int port = cfg.value("port", 5280);
			d->client->setConnection(new ConnectionBOSH(host, port));
		}
		cfg.endGroup();
	}
	d->client->setJID(jid);
	if(!cfg.value("autoDetect",true)) {
		d->client->setPort(cfg.value("port", 5222));
		d->client->setServer(cfg.value("server",d->client->server()));
	}

	cfg.endGroup();
}