aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-07-08 12:47:01 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-07-08 12:47:01 +0000
commitf24306761d73480962ce4604607f4abf19806742 (patch)
treebce9528f5f493ab61027aef21fc616df3f60c408 /source
parentf4367130d868e9a4e9abcbfaecde350c9230c218 (diff)
downloadqxmpp-f24306761d73480962ce4604607f4abf19806742.tar.gz
add QXmppIq::parseElementFromChild() to make it symetrical to parsing
Diffstat (limited to 'source')
-rw-r--r--source/QXmppIq.cpp5
-rw-r--r--source/QXmppIq.h4
2 files changed, 7 insertions, 2 deletions
diff --git a/source/QXmppIq.cpp b/source/QXmppIq.cpp
index 55d72748..c4215d5f 100644
--- a/source/QXmppIq.cpp
+++ b/source/QXmppIq.cpp
@@ -52,9 +52,12 @@ void QXmppIq::setType(QXmppIq::Type type)
void QXmppIq::parse(const QDomElement &element)
{
QXmppStanza::parse(element);
-
setTypeFromStr(element.attribute("type"));
+ parseElementFromChild(element);
+}
+void QXmppIq::parseElementFromChild(const QDomElement &element)
+{
QXmppElementList extensions;
QDomElement itemElement = element.firstChildElement();
while (!itemElement.isNull())
diff --git a/source/QXmppIq.h b/source/QXmppIq.h
index 0796ef3c..65dfdb4a 100644
--- a/source/QXmppIq.h
+++ b/source/QXmppIq.h
@@ -52,12 +52,14 @@ public:
void parse(const QDomElement &element);
void toXml(QXmlStreamWriter *writer) const;
- virtual void toXmlElementFromChild(QXmlStreamWriter *writer) const;
// deprecated accessors, use the form without "get" instead
QXmppIq::Type Q_DECL_DEPRECATED getType() const;
protected:
+ virtual void parseElementFromChild(const QDomElement &element);
+ virtual void toXmlElementFromChild(QXmlStreamWriter *writer) const;
+
QString getTypeStr() const;
void setTypeFromStr(const QString& str);