diff options
Diffstat (limited to 'source/QXmppIq.cpp')
| -rw-r--r-- | source/QXmppIq.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/source/QXmppIq.cpp b/source/QXmppIq.cpp index a28e6f8d..981ffeb7 100644 --- a/source/QXmppIq.cpp +++ b/source/QXmppIq.cpp @@ -25,6 +25,7 @@ #include "QXmppUtils.h" #include "QXmppIq.h" +#include <QDomElement> #include <QXmlStreamWriter> QXmppIq::QXmppIq(QXmppIq::Type type) @@ -55,6 +56,20 @@ void QXmppIq::setType(QXmppIq::Type type) m_type = type; } +void QXmppIq::parse( QDomElement &element ) +{ + setFrom(element.attribute("from")); + setTo(element.attribute("to")); + setTypeFromStr(element.attribute("type")); + + QDomElement itemElement = element.firstChildElement(); + while (!itemElement.isNull()) + { + m_items.append(QXmppElement(itemElement)); + itemElement = itemElement.nextSiblingElement(); + } +} + void QXmppIq::toXml( QXmlStreamWriter *xmlWriter ) const { xmlWriter->writeStartElement("iq"); @@ -126,12 +141,12 @@ void QXmppIq::setTypeFromStr(const QString& str) } } -QList<QXmppElement> QXmppIq::getItems() const +QXmppElementList QXmppIq::getItems() const { return m_items; } -void QXmppIq::setItems(const QList<QXmppElement> &items) +void QXmppIq::setItems(const QXmppElementList &items) { m_items = items; } |
