diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-02-22 19:06:59 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-02-22 19:06:59 +0000 |
| commit | 8e78c35501a97635c1f374429d1e87350242c186 (patch) | |
| tree | dde063299448ed321fa80157b6e85dd91aa624ea /source/QXmppIq.cpp | |
| parent | 48209ff6f17233b995b4a1dc9879a4ef15757c81 (diff) | |
| download | qxmpp-8e78c35501a97635c1f374429d1e87350242c186.tar.gz | |
use QXmppStanza::getExtensions/setExtensions instead of QXmppIq::getItems/setItems
Diffstat (limited to 'source/QXmppIq.cpp')
| -rw-r--r-- | source/QXmppIq.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/source/QXmppIq.cpp b/source/QXmppIq.cpp index 981ffeb7..0c0ceee4 100644 --- a/source/QXmppIq.cpp +++ b/source/QXmppIq.cpp @@ -58,16 +58,19 @@ void QXmppIq::setType(QXmppIq::Type type) void QXmppIq::parse( QDomElement &element ) { + setId(element.attribute("id")); setFrom(element.attribute("from")); setTo(element.attribute("to")); setTypeFromStr(element.attribute("type")); + QXmppElementList extensions; QDomElement itemElement = element.firstChildElement(); while (!itemElement.isNull()) { - m_items.append(QXmppElement(itemElement)); + extensions.append(QXmppElement(itemElement)); itemElement = itemElement.nextSiblingElement(); } + setExtensions(extensions); } void QXmppIq::toXml( QXmlStreamWriter *xmlWriter ) const @@ -88,8 +91,8 @@ void QXmppIq::toXml( QXmlStreamWriter *xmlWriter ) const void QXmppIq::toXmlElementFromChild( QXmlStreamWriter *writer ) const { - foreach (const QXmppElement &item, m_items) - item.toXml(writer); + foreach (const QXmppElement &extension, getExtensions()) + extension.toXml(writer); } QString QXmppIq::getTypeStr() const @@ -141,13 +144,3 @@ void QXmppIq::setTypeFromStr(const QString& str) } } -QXmppElementList QXmppIq::getItems() const -{ - return m_items; -} - -void QXmppIq::setItems(const QXmppElementList &items) -{ - m_items = items; -} - |
