コード例 #1
0
bool RosterItemExchange::rosterDragEnter(const QDragEnterEvent *AEvent)
{
	if (AEvent->source()==FRostersViewPlugin->rostersView()->instance() && AEvent->mimeData()->hasFormat(DDT_ROSTERSVIEW_INDEX_DATA))
	{
		QMap<int, QVariant> indexData;
		QDataStream stream(AEvent->mimeData()->data(DDT_ROSTERSVIEW_INDEX_DATA));
		operator>>(stream,indexData);

		if (DragRosterKinds.contains(indexData.value(RDR_KIND).toInt()))
		{
			Jid indexJid = indexData.value(RDR_PREP_BARE_JID).toString();
			if (indexJid.hasNode())
			{
				QList<Jid> services = FGateways!=NULL ? FGateways->streamServices(indexData.value(RDR_STREAM_JID).toString()) : QList<Jid>();
				return !services.contains(indexJid.domain());
			}
			return true;
		}
	}
	return false;
}