本文整理汇总了C++中JID::domain方法的典型用法代码示例。如果您正苦于以下问题:C++ JID::domain方法的具体用法?C++ JID::domain怎么用?C++ JID::domain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JID
的用法示例。
在下文中一共展示了JID::domain方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateParameters
QStringList JAccount::updateParameters(const QVariantMap ¶meters, bool forced)
{
Q_D(JAccount);
QStringList result;
if (!forced && d->parameters == parameters)
return result;
if (forced)
d->hasChangedParameters = false;
QString password = parameters.value(QLatin1String("password")).toString();
QString server = parameters.value(QLatin1String("connect-server")).toString();
int port = parameters.value(QLatin1String("port"), -1).toInt();
QString boshServer = parameters.value(QLatin1String("bosh-server")).toString();
int boshPort = parameters.value(QLatin1String("bosh-port"), -1).toInt();
QString resource = parameters.value(QLatin1String("resource")).toString();
int priority = parameters.value(QLatin1String("priority"), 30).toInt();
Presence &presence = d->client->presence();
presence.setPriority(priority);
if (d->client->isConnected()) {
d->hasChangedParameters = true;
d->client->send(presence);
if (d->client->server() != server)
result << QLatin1String("connect-server");
if (d->client->port() != port)
result << QLatin1String("port");
if (d->client->jid().resource() != resource)
result << QLatin1String("resource");
} else {
JID jid = d->client->jid();
jid.setResource(resource);
d->client->setServer(port < 0 ? jid.domain() : server);
d->client->setPort(port);
}
d->client->setPassword(password);
if (!forced) {
Config config = Account::config();
config.setValue(QLatin1String("resource"), resource);
config.setValue(QLatin1String("priority"), priority);
config.setValue(QLatin1String("autoDetect"), port < 0);
config.setValue(QLatin1String("server"), server);
config.setValue(QLatin1String("port"), port);
config.setValue(QLatin1String("passwd"), password, Config::Crypted);
config.beginGroup(QLatin1String("bosh"));
config.setValue(QLatin1String("use"), !boshServer.isEmpty());
config.setValue(QLatin1String("server"), boshServer);
config.setValue(QLatin1String("port"), boshPort);
config.endGroup();
}
d->parameters = parameters;
emit parametersChanged(d->parameters);
return result;
}