diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-07-08 13:08:33 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-07-08 13:08:33 +0000 |
| commit | 8a07e9025a1865bcdcaa652665dbc97deac1ec16 (patch) | |
| tree | 81b526b69b6d13ef6ae73e1c9bba2b979bd7c07f /source/QXmppRpcIq.cpp | |
| parent | f24306761d73480962ce4604607f4abf19806742 (diff) | |
| download | qxmpp-8a07e9025a1865bcdcaa652665dbc97deac1ec16.tar.gz | |
use parseElementFromChild in all IQ classes
Diffstat (limited to 'source/QXmppRpcIq.cpp')
| -rw-r--r-- | source/QXmppRpcIq.cpp | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/source/QXmppRpcIq.cpp b/source/QXmppRpcIq.cpp index 985fc562..7bc5ee7f 100644 --- a/source/QXmppRpcIq.cpp +++ b/source/QXmppRpcIq.cpp @@ -9,11 +9,6 @@ QXmppRpcErrorIq::QXmppRpcErrorIq() : QXmppIq( QXmppIq::Error ) } -void QXmppRpcErrorIq::toXmlElementFromChild(QXmlStreamWriter *writer) const -{ - m_query.toXmlElementFromChild(writer); -} - void QXmppRpcErrorIq::setQuery(const QXmppRpcInvokeIq &query ) { m_query = query; @@ -34,11 +29,14 @@ bool QXmppRpcErrorIq::isRpcErrorIq(const QDomElement &element) queryElement.namespaceURI() == ns_rpc; } -void QXmppRpcErrorIq::parse(const QDomElement &element) +void QXmppRpcErrorIq::parseElementFromChild(const QDomElement &element) { - QXmppStanza::parse(element); + m_query.parseElementFromChild(element); +} - setTypeFromStr(element.attribute("type")); +void QXmppRpcErrorIq::toXmlElementFromChild(QXmlStreamWriter *writer) const +{ + m_query.toXmlElementFromChild(writer); } QXmppRpcResponseIq::QXmppRpcResponseIq() : QXmppIq( QXmppIq::Result ) @@ -63,18 +61,13 @@ bool QXmppRpcResponseIq::isRpcResponseIq(const QDomElement &element) type == "result"; } -void QXmppRpcResponseIq::parse(const QDomElement &element) +void QXmppRpcResponseIq::parseElementFromChild(const QDomElement &element) { - QXmppStanza::parse(element); - - setTypeFromStr(element.attribute("type")); - QDomElement queryElement = element.firstChildElement("query"); QDomElement methodElement = queryElement.firstChildElement("methodResponse"); XMLRPC::ResponseMessage message( methodElement ); m_payload = message.value(); - } void QXmppRpcResponseIq::toXmlElementFromChild(QXmlStreamWriter *writer) const @@ -126,12 +119,8 @@ bool QXmppRpcInvokeIq::isRpcInvokeIq(const QDomElement &element) type == "set"; } -void QXmppRpcInvokeIq::parse(const QDomElement &element) +void QXmppRpcInvokeIq::parseElementFromChild(const QDomElement &element) { - QXmppStanza::parse(element); - - setTypeFromStr(element.attribute("type")); - QDomElement queryElement = element.firstChildElement("query"); QDomElement methodElement = queryElement.firstChildElement("methodCall"); @@ -140,7 +129,6 @@ void QXmppRpcInvokeIq::parse(const QDomElement &element) m_interface = message.method().split('.').value(0); m_method = message.method().split('.').value(1); m_payload = message.args(); - } void QXmppRpcInvokeIq::toXmlElementFromChild(QXmlStreamWriter *writer) const |
