diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-10-29 16:03:46 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-10-29 16:03:46 +0000 |
| commit | ff65bdcfe93d3285079f4509f82d5e24cef88e81 (patch) | |
| tree | 2a11d29fe285d443d2a8f21e16da96acd0a9f847 /src/QXmppEntityTimeIq.cpp | |
| parent | 3256b370c24c00fa61b7e232c73deef9c1f71b11 (diff) | |
| download | qxmpp-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.cpp | 10 |
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(); } |
