From bb95ebd0e305071ccea30e356844042402bcd76b Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Thu, 4 Mar 2010 08:43:53 +0000 Subject: regroup common stanza parsing inside QXmppStanza::parse() --- source/QXmppDiscoveryIq.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source/QXmppDiscoveryIq.cpp') diff --git a/source/QXmppDiscoveryIq.cpp b/source/QXmppDiscoveryIq.cpp index b54df435..36052dd6 100644 --- a/source/QXmppDiscoveryIq.cpp +++ b/source/QXmppDiscoveryIq.cpp @@ -47,18 +47,17 @@ void QXmppDiscoveryIq::setQueryType(enum QXmppDiscoveryIq::QueryType type) m_queryType = type; } -bool QXmppDiscoveryIq::isDiscoveryIq( QDomElement &element ) +bool QXmppDiscoveryIq::isDiscoveryIq(const QDomElement &element) { QDomElement queryElement = element.firstChildElement("query"); return (queryElement.namespaceURI() == ns_disco_info || queryElement.namespaceURI() == ns_disco_items); } -void QXmppDiscoveryIq::parse( QDomElement &element ) +void QXmppDiscoveryIq::parse(const QDomElement &element) { - setId(element.attribute("id")); - setFrom(element.attribute("from")); - setTo(element.attribute("to")); + QXmppStanza::parse(element); + setTypeFromStr(element.attribute("type")); QDomElement queryElement = element.firstChildElement("query"); if (queryElement.namespaceURI() == ns_disco_items) -- cgit v1.2.3