aboutsummaryrefslogtreecommitdiff
path: root/src/QXmppEntityTimeIq.cpp
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-10-29 16:03:46 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-10-29 16:03:46 +0000
commitff65bdcfe93d3285079f4509f82d5e24cef88e81 (patch)
tree2a11d29fe285d443d2a8f21e16da96acd0a9f847 /src/QXmppEntityTimeIq.cpp
parent3256b370c24c00fa61b7e232c73deef9c1f71b11 (diff)
downloadqxmpp-ff65bdcfe93d3285079f4509f82d5e24cef88e81.tar.gz
QXmppEntityTimeIq::utc() should return a QDateTime, the user should not have to implement parsing / serialization
Diffstat (limited to 'src/QXmppEntityTimeIq.cpp')
-rw-r--r--src/QXmppEntityTimeIq.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/QXmppEntityTimeIq.cpp b/src/QXmppEntityTimeIq.cpp
index 56cc6f94..d86579aa 100644
--- a/src/QXmppEntityTimeIq.cpp
+++ b/src/QXmppEntityTimeIq.cpp
@@ -39,12 +39,12 @@ void QXmppEntityTimeIq::setTzo(const QString &tzo)
m_tzo = tzo;
}
-QString QXmppEntityTimeIq::utc() const
+QDateTime QXmppEntityTimeIq::utc() const
{
return m_utc;
}
-void QXmppEntityTimeIq::setUtc(const QString &utc)
+void QXmppEntityTimeIq::setUtc(const QDateTime &utc)
{
m_utc = utc;
}
@@ -59,7 +59,7 @@ void QXmppEntityTimeIq::parseElementFromChild(const QDomElement &element)
{
QDomElement timeElement = element.firstChildElement("time");
m_tzo = timeElement.firstChildElement("tzo").text();
- m_utc = timeElement.firstChildElement("utc").text();
+ m_utc = datetimeFromString(timeElement.firstChildElement("utc").text());
}
void QXmppEntityTimeIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
@@ -70,8 +70,8 @@ void QXmppEntityTimeIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
if(!m_tzo.isEmpty())
helperToXmlAddTextElement(writer, "tzo", m_tzo);
- if(!m_utc.isEmpty())
- helperToXmlAddTextElement(writer, "utc", m_utc);
+ if(m_utc.isValid())
+ helperToXmlAddTextElement(writer, "utc", datetimeToString(m_utc));
writer->writeEndElement();
}