diff options
| -rw-r--r-- | examples/GuiClient/capabilitiesCollection.cpp | 32 | ||||
| -rw-r--r-- | examples/GuiClient/capabilitiesCollection.h | 3 |
2 files changed, 35 insertions, 0 deletions
diff --git a/examples/GuiClient/capabilitiesCollection.cpp b/examples/GuiClient/capabilitiesCollection.cpp index 440ebaaa..084b31a7 100644 --- a/examples/GuiClient/capabilitiesCollection.cpp +++ b/examples/GuiClient/capabilitiesCollection.cpp @@ -142,3 +142,35 @@ void capabilitiesCollection::saveToCache(const QString& nodeVer) file.close();
}
}
+
+QStringList capabilitiesCollection::getFeatures(const QString& nodeVer)
+{
+ if(!m_mapCapabilities.contains(nodeVer))
+ return QStringList();
+
+ return m_mapCapabilities[nodeVer].features();
+}
+
+QStringList capabilitiesCollection::getIdentities(const QString& nodeVer)
+{
+ if(!m_mapCapabilities.contains(nodeVer))
+ return QStringList();
+
+ QStringList idList;
+ QList<QXmppDiscoveryIq::Identity> list = m_mapCapabilities[nodeVer].identities();
+ foreach(QXmppDiscoveryIq::Identity identity, list)
+ {
+ QStringList tmpList;
+ if(!identity.name().isEmpty())
+ tmpList << identity.name();
+ if(!identity.category().isEmpty())
+ tmpList << identity.category();
+ if(!identity.type().isEmpty())
+ tmpList << identity.type();
+ if(!identity.language().isEmpty())
+ tmpList << identity.language();
+ idList << tmpList.join(" | ");
+ }
+ return idList;
+}
+
diff --git a/examples/GuiClient/capabilitiesCollection.h b/examples/GuiClient/capabilitiesCollection.h index c4636321..59a78758 100644 --- a/examples/GuiClient/capabilitiesCollection.h +++ b/examples/GuiClient/capabilitiesCollection.h @@ -45,6 +45,9 @@ public: void loadAllFromCache();
void saveToCache(const QString& nodeVer);
+ QStringList getFeatures(const QString& nodeVer);
+ QStringList getIdentities(const QString& nodeVer);
+
signals:
private slots:
|
