QString StatusIcons::iconsetByJid(const Jid &AContactJid) const { QString &substorage = FJid2Storage[AContactJid]; if (substorage.isEmpty()) { QRegExp regExp; regExp.setCaseSensitivity(Qt::CaseSensitive); QString contactStr = AContactJid.pFull(); for (QMap<QString, QString>::const_iterator it=FUserRules.constBegin(); substorage.isEmpty() && it!=FUserRules.constEnd(); ++it) { regExp.setPattern(it.key()); if (contactStr.contains(regExp)) substorage = it.value(); } for (QMap<QString, QString>::const_iterator it=FDefaultRules.constBegin(); substorage.isEmpty() && it!=FDefaultRules.constEnd(); ++it) { regExp.setPattern(it.key()); if (contactStr.contains(regExp)) substorage = it.value(); } if (substorage.isEmpty()) substorage = FDefaultStorage!=NULL ? FDefaultStorage->subStorage() : FILE_STORAGE_SHARED_DIR; } return substorage; }
void Annotations::updateDataHolder(const Jid &AStreamJid, const QList<Jid> &AContactJids) { IRosterIndex *sroot = FRostersModel!=NULL ? FRostersModel->streamRoot(AStreamJid) : NULL; if (sroot && !AContactJids.isEmpty()) { QMultiMap<int,QVariant> findData; foreach(const Jid &contactJid, AContactJids) findData.insertMulti(RDR_PREP_BARE_JID,contactJid.pBare()); findData.insertMulti(RDR_STREAM_JID,AStreamJid.pFull()); foreach (IRosterIndex *index, sroot->findChilds(findData,true)) emit rosterDataChanged(index,RDR_ANNOTATIONS); }
uint qHash(const Jid &AKey) { return qHash(AKey.pFull()); }
QString SocksStreams::connectionKey(const QString &ASessionId, const Jid &AInitiator, const Jid &ATarget) const { QString keyString = ASessionId + AInitiator.pFull() + ATarget.pFull(); QByteArray keyData = QCryptographicHash::hash(keyString.toUtf8(), QCryptographicHash::Sha1).toHex(); return QString::fromUtf8(keyData.constData(), keyData.size()).toLower(); }