本文整理汇总了C++中qxmpprosteriq::Item::name方法的典型用法代码示例。如果您正苦于以下问题:C++ Item::name方法的具体用法?C++ Item::name怎么用?C++ Item::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qxmpprosteriq::Item
的用法示例。
在下文中一共展示了Item::name方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: itemChanged
void MyXmppClient::itemChanged(const QString &bareJid ) {
qDebug() << "MyXmppClient::itemChanged(): " << bareJid;
QXmppRosterIq::Item rosterEntry = rosterManager->getRosterEntry( bareJid );
if (rosterEntry.name() != "") {
RosterItemModel *item = (RosterItemModel*)cachedRoster->find( bareJid );
if( item != 0 ) item->setContactName( rosterEntry.name() );
emit contactRenamed(bareJid,rosterEntry.name());
item = 0; delete item;
}
}
示例2: UpdateUserInfo
int CUserInfoXmpp::UpdateUserInfo(const QXmppRosterIq::Item &rosterItem)
{
if(m_szJid.isEmpty())
m_szJid = rosterItem.bareJid();
m_Groups = rosterItem.groups();
SetName(rosterItem.name());
m_subscriptionType = FromQxmppSubscriptionType(rosterItem.subscriptionType());
return 0;
}
示例3: initVCard
void MyXmppClient::initVCard(const QXmppVCardIq &vCard)
{
QString bareJid = vCard.from();
RosterItemModel *item = (RosterItemModel*)cachedRoster->find( bareJid );
vCardData dataVCard;
if( item != 0 )
{
/* set nickname */
QXmppRosterIq::Item itemRoster = rosterManager->getRosterEntry( bareJid );
QString nickName = vCard.nickName();
if( (!nickName.isEmpty()) && (!nickName.isNull()) && (itemRoster.name().isEmpty()) ) {
qDebug() << "MyXmppClient::initPresence: updating name for"<< bareJid;
item->setContactName( nickName );
}
/* avatar */
bool isAvatarCreated = true;
QString avatarFile = cacheIM->getAvatarCache( bareJid );
if( (avatarFile.isEmpty() || avatarFile == "qrc:/avatar" || (flVCardRequest != "")) && vCard.photo() != "" ) {
isAvatarCreated = cacheIM->setAvatarCache( bareJid, vCard.photo() );
}
item->setAvatar(cacheIM->getAvatarCache(bareJid));
dataVCard.nickName = nickName;
dataVCard.firstName = vCard.firstName();
dataVCard.fullName = vCard.fullName();;
dataVCard.middleName = vCard.middleName();
dataVCard.lastName = vCard.lastName();
dataVCard.url = vCard.url();
dataVCard.eMail = vCard.email();
if( flVCardRequest == bareJid ) {
qmlVCard->setPhoto( avatarFile );
qmlVCard->setNickName( vCard.nickName() );
qmlVCard->setMiddleName( vCard.middleName() );
qmlVCard->setLastName( vCard.lastName() );
qmlVCard->setFullName( vCard.fullName() );
qmlVCard->setName( vCard.firstName() );
qmlVCard->setBirthday( vCard.birthday().toString("dd.MM.yyyy") );
qmlVCard->setEMail( vCard.email() );
qmlVCard->setUrl( vCard.url() );
qmlVCard->setJid( bareJid );
flVCardRequest = "";
emit vCardChanged();
}
cacheIM->setVCard( bareJid, dataVCard );
}
}
示例4: initRoster
void MyXmppClient::initRoster() {
qDebug() << "MyXmppClient::initRoster() called";
if (!rosterManager->isRosterReceived()) {
qDebug() << "MyXmppClient::initRoster(): roster not available yet";
return;
}
cachedRoster->cleanList();
QStringList listBareJids = rosterManager->getRosterBareJids();
for( int j=0; j < listBareJids.length(); j++ )
{
QString bareJid = listBareJids.at(j);
cacheIM->addCacheJid( bareJid );
QXmppRosterIq::Item itemRoster = rosterManager->getRosterEntry( bareJid );
QString name = itemRoster.name();
vCardData vCdata = cacheIM->getVCard( bareJid );
if ( vCdata.isEmpty() && !disableAvatarCaching ) {
qDebug() << "MyXmppClient::initRoster():" << bareJid << "has no VCard. Requesting.";
vCardManager->requestVCard( bareJid );
}
RosterItemModel *itemExists = (RosterItemModel*)cachedRoster->find(bareJid);
if (itemExists == 0) {
RosterItemModel *itemModel = new RosterItemModel( );
itemModel->setPresence( this->getPicPresence( QXmppPresence::Unavailable ) );
itemModel->setContactName( name );
itemModel->setJid( bareJid );
itemModel->setAvatar(cacheIM->getAvatarCache(bareJid));
cachedRoster->append(itemModel);
itemModel = 0;
delete itemModel;
} else if (itemExists->name() != name) {
itemExists->setContactName(name);
emit contactRenamed(bareJid,name);
}
itemExists = 0; delete itemExists;
}
emit rosterChanged();
}
示例5: initVCard
void MyXmppClient::initVCard(const QXmppVCardIq &vCard)
{
QString bareJid = vCard.from();
RosterItemModel *item = (RosterItemModel*)cachedRoster->find( bareJid );
vCardData dataVCard;
if( item != 0 )
{
/* set nickname */
QXmppRosterIq::Item itemRoster = rosterManager->getRosterEntry( bareJid );
QString nickName = vCard.nickName();
if( (!nickName.isEmpty()) && (!nickName.isNull()) && (itemRoster.name().isEmpty()) ) {
qDebug() << "MyXmppClient::initPresence: updating name for"<< bareJid;
item->setContactName( nickName );
}
/* avatar */
bool isAvatarCreated = true;
QString avatarFile = cacheIM->getAvatarCache( bareJid );
if( (avatarFile.isEmpty() || avatarFile == "qrc:/avatar") && vCard.photo() != "" && !disableAvatarCaching) {
isAvatarCreated = cacheIM->setAvatarCache( bareJid, vCard.photo() );
}
item->setAvatar(cacheIM->getAvatarCache(bareJid));
dataVCard.nickName = nickName;
dataVCard.firstName = vCard.firstName();
dataVCard.fullName = vCard.fullName();;
dataVCard.middleName = vCard.middleName();
dataVCard.lastName = vCard.lastName();
dataVCard.url = vCard.url();
dataVCard.eMail = vCard.email();
cacheIM->setVCard( bareJid, dataVCard );
}
}