当前位置: 首页>>代码示例>>C++>>正文


C++ QXmppPresence::statusText方法代码示例

本文整理汇总了C++中QXmppPresence::statusText方法的典型用法代码示例。如果您正苦于以下问题:C++ QXmppPresence::statusText方法的具体用法?C++ QXmppPresence::statusText怎么用?C++ QXmppPresence::statusText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QXmppPresence的用法示例。


在下文中一共展示了QXmppPresence::statusText方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetStatus

	EntryStatus GlooxCLEntry::GetStatus (const QString& variant) const
	{
		if (ODS_)
			return EntryStatus ();

		if (AuthRequested_)
			return EntryStatus (SOnline, QString ());

		QXmppRosterManager& rm = Account_->
				GetClientConnection ()->GetClient ()->rosterManager ();
		if (!rm.isRosterReceived ())
			return EntryBase::GetStatus (variant);

		const QMap<QString, QXmppPresence>& press = rm.getAllPresencesForBareJid (GetJID ());
		if (!press.size ())
			return EntryBase::GetStatus (variant);

		QXmppPresence max = press.begin ().value ();
		Q_FOREACH (const QString& resource, press.keys ())
		{
			if (!variant.isEmpty () && variant == resource)
			{
				max = press [resource];
				break;
			}
			const QXmppPresence& pres = press [resource];
			if (pres.priority () > max.priority ())
				max = pres;
		}
		return EntryStatus (static_cast<State> (max.availableStatusType () + 1),
				max.statusText ());
	}
开发者ID:Kalarel,项目名称:leechcraft,代码行数:32,代码来源:glooxclentry.cpp

示例2: PresenceToStatus

	EntryStatus PresenceToStatus (const QXmppPresence& pres)
	{
		EntryStatus st (static_cast<State> (pres.availableStatusType () + 1), pres.statusText ());
		if (pres.type () == QXmppPresence::Unavailable)
			st.State_ = SOffline;
		return st;
	}
开发者ID:AlexWMF,项目名称:leechcraft,代码行数:7,代码来源:util.cpp

示例3: presenceToStatusText

QString presenceToStatusText(const QXmppPresence& presence)
{
    QString statusText = presence.statusText();
    if(statusText.isEmpty())
    {
        if(presence.type() == QXmppPresence::Available)
        {
            switch(presence.availableStatusType())
            {
            case QXmppPresence::Invisible:
                statusText = "Offline";
                break;
            case QXmppPresence::Online:
            case QXmppPresence::Chat:
                statusText = "Available";
                break;
            case QXmppPresence::Away:
            case QXmppPresence::XA:
                statusText = "Idle";
                break;
            case QXmppPresence::DND:
                statusText = "Busy";
                break;
            }
        }
        else
            statusText = "Offline";
    }

    return statusText;
}
开发者ID:balazsbela,项目名称:streamphony,代码行数:31,代码来源:utils.cpp

示例4: slotChangedPresence

//好友出席状态改变  
void CFrmUserList::slotChangedPresence(const QXmppPresence &presence)
{
    LOG_MODEL_DEBUG("Roster", "CFrmUserList::ChangedPresence jid:%s;status:%d;status text:%s",
           qPrintable(presence.from()),
           presence.availableStatusType(),
           qPrintable(presence.statusText())
           );

    QString bareJid = QXmppUtils::jidToBareJid(presence.from());
    QMap<QString, CRoster*>::iterator it = m_Rosters.find(bareJid);
    if(m_Rosters.end() != it)
    {
        it.value()->ChangedPresence(presence.from(), presence.availableStatusType());
    }
}
开发者ID:anchowee,项目名称:rabbitim,代码行数:16,代码来源:FrmUserList.cpp

示例5: initPresence

void MyXmppClient::initPresence(const QString& bareJid, const QString& resource)
{
    int indxItem = -1;
    RosterItemModel *item = (RosterItemModel*)cachedRoster->find( bareJid, indxItem );

    if( item == 0 ) {
        return;
    }

    QXmppPresence xmppPresence = rosterManager->getPresence( bareJid, resource );
    QXmppPresence::Type statusJid = xmppPresence.type();

    QStringList _listResources = this->getResourcesByJid( bareJid );
    if( (_listResources.count() > 0) && (!_listResources.contains(resource)) )
    {
        qDebug() << bareJid << "/" << resource << " ****************[" <<_listResources<<"]" ;
        if( statusJid == QXmppPresence::Unavailable ) {
            return;
        }
    }

    item->setResource( resource );

    QString picStatus = this->getPicPresence( xmppPresence );
    item->setPresence( picStatus );

    QString txtStatus = this->getTextStatus( xmppPresence.statusText(), xmppPresence );
    item->setStatusText( txtStatus );

    RosterItemModel *itemExists = (RosterItemModel*)cachedRoster->find( bareJid, indxItem );

    if( itemExists != 0 ) {
        itemExists->copy( item );
        QString picStatusPrev = itemExists->presence();
        if( picStatusPrev != picStatus )
        {
            //emit presenceJidChanged( bareJid, txtStatus, picStatus );
            emit rosterChanged();
        }
    }
    item = 0; itemExists = 0;
    delete item; delete itemExists;

    emit contactStatusChanged(m_accountId,bareJid);
}
开发者ID:ksiazkowicz,项目名称:lightbulb,代码行数:45,代码来源:MyXmppClient.cpp

示例6: setPresence

void rosterItem::setPresence(const QXmppPresence &presence)
{
    // determine status text
    QString statusText = presence.statusText();
    if (statusText.isEmpty()) {
        if(presence.type() == QXmppPresence::Available)
            statusText = "Available";
        else if(presence.type() == QXmppPresence::Unavailable)
            statusText = "Offline";
    }

    // store data
    setData(statusText, rosterItem::StatusText);
    setData(static_cast<int>(presence.type()), PresenceType);
    setData(static_cast<int>(presence.availableStatusType()), StatusType);

    // update icon
    QString icon;
    if (presence.type() == QXmppPresence::Available) {
        switch (presence.availableStatusType())
        {
        case QXmppPresence::Online:
        case QXmppPresence::Chat:
            icon = "green";
            break;
        case QXmppPresence::Away:
        case QXmppPresence::XA:
            icon = "orange";
            break;
        case QXmppPresence::DND:
            icon = "red";
            break;
        case QXmppPresence::Invisible:
            icon = "gray";
            break;
        }
    } else {
        icon = "gray";
    }
    if (!icon.isEmpty())
        setIcon(QIcon(":/icons/resource/"+icon+".png"));
}
开发者ID:Aseman-Land,项目名称:qxmpp,代码行数:42,代码来源:rosterItem.cpp


注:本文中的QXmppPresence::statusText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。