aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2011-01-21 13:41:49 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2011-01-21 13:41:49 +0000
commit545d50cef4cce7dc93ac568a78c0ed0d902527f6 (patch)
tree499884a03d6caf289fce535248f6c48402dc1f98 /src
parentb0faa20df3346fa7b8a3ab938d9a4c4a2e3eac5d (diff)
downloadqxmpp-545d50cef4cce7dc93ac568a78c0ed0d902527f6.tar.gz
when writing "xmlns", always use QXmlStreamWriter::writeAttribute(), we *know* the value is not empty
Diffstat (limited to 'src')
-rw-r--r--src/QXmppArchiveIq.cpp12
-rw-r--r--src/QXmppBindIq.cpp2
-rw-r--r--src/QXmppByteStreamIq.cpp2
-rw-r--r--src/QXmppDataForm.cpp2
-rw-r--r--src/QXmppDiscoveryIq.cpp2
-rw-r--r--src/QXmppElement.cpp2
-rw-r--r--src/QXmppEntityTimeIq.cpp2
-rw-r--r--src/QXmppJingleIq.cpp8
-rw-r--r--src/QXmppMessage.cpp6
-rw-r--r--src/QXmppMucIq.cpp4
-rw-r--r--src/QXmppPingIq.cpp2
-rw-r--r--src/QXmppPresence.cpp4
-rw-r--r--src/QXmppPubSubIq.cpp2
-rw-r--r--src/QXmppRpcIq.cpp4
-rw-r--r--src/QXmppStanza.cpp6
-rw-r--r--src/QXmppStreamInitiationIq.cpp2
-rw-r--r--src/QXmppVCardIq.cpp2
-rw-r--r--src/QXmppVersionIq.cpp2
18 files changed, 33 insertions, 33 deletions
diff --git a/src/QXmppArchiveIq.cpp b/src/QXmppArchiveIq.cpp
index 6022e806..706fe2e6 100644
--- a/src/QXmppArchiveIq.cpp
+++ b/src/QXmppArchiveIq.cpp
@@ -112,7 +112,7 @@ void QXmppArchiveChat::parse(const QDomElement &element)
void QXmppArchiveChat::toXml(QXmlStreamWriter *writer) const
{
writer->writeStartElement("chat");
- helperToXmlAddAttribute(writer, "xmlns", ns_archive);
+ writer->writeAttribute("xmlns", ns_archive);
helperToXmlAddAttribute(writer, "with", m_with);
if (m_start.isValid())
helperToXmlAddAttribute(writer, "start", datetimeToString(m_start));
@@ -367,7 +367,7 @@ void QXmppArchiveListIq::parseElementFromChild(const QDomElement &element)
void QXmppArchiveListIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
writer->writeStartElement("list");
- helperToXmlAddAttribute(writer, "xmlns", ns_archive);
+ writer->writeAttribute("xmlns", ns_archive);
if (!m_with.isEmpty())
helperToXmlAddAttribute(writer, "with", m_with);
if (m_start.isValid())
@@ -377,7 +377,7 @@ void QXmppArchiveListIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
if (m_max > 0)
{
writer->writeStartElement("set");
- helperToXmlAddAttribute(writer, "xmlns", ns_rsm);
+ writer->writeAttribute("xmlns", ns_rsm);
helperToXmlAddTextElement(writer, "max", QString::number(m_max));
writer->writeEndElement();
}
@@ -401,7 +401,7 @@ void QXmppArchivePrefIq::parseElementFromChild(const QDomElement &element)
void QXmppArchivePrefIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
writer->writeStartElement("pref");
- helperToXmlAddAttribute(writer, "xmlns", ns_archive);
+ writer->writeAttribute("xmlns", ns_archive);
writer->writeEndElement();
}
@@ -480,13 +480,13 @@ void QXmppArchiveRetrieveIq::parseElementFromChild(const QDomElement &element)
void QXmppArchiveRetrieveIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
writer->writeStartElement("retrieve");
- helperToXmlAddAttribute(writer, "xmlns", ns_archive);
+ writer->writeAttribute("xmlns", ns_archive);
helperToXmlAddAttribute(writer, "with", m_with);
helperToXmlAddAttribute(writer, "start", datetimeToString(m_start));
if (m_max > 0)
{
writer->writeStartElement("set");
- helperToXmlAddAttribute(writer, "xmlns", ns_rsm);
+ writer->writeAttribute("xmlns", ns_rsm);
helperToXmlAddTextElement(writer, "max", QString::number(m_max));
writer->writeEndElement();
}
diff --git a/src/QXmppBindIq.cpp b/src/QXmppBindIq.cpp
index 4548b23b..f818e002 100644
--- a/src/QXmppBindIq.cpp
+++ b/src/QXmppBindIq.cpp
@@ -80,7 +80,7 @@ void QXmppBindIq::parseElementFromChild(const QDomElement &element)
void QXmppBindIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
writer->writeStartElement("bind");
- helperToXmlAddAttribute(writer, "xmlns", ns_bind);
+ writer->writeAttribute("xmlns", ns_bind);
if (!m_jid.isEmpty())
helperToXmlAddTextElement(writer, "jid", m_jid);
if (!m_resource.isEmpty())
diff --git a/src/QXmppByteStreamIq.cpp b/src/QXmppByteStreamIq.cpp
index 32ee5b17..e1628e72 100644
--- a/src/QXmppByteStreamIq.cpp
+++ b/src/QXmppByteStreamIq.cpp
@@ -153,7 +153,7 @@ void QXmppByteStreamIq::parseElementFromChild(const QDomElement &element)
void QXmppByteStreamIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
writer->writeStartElement("query");
- helperToXmlAddAttribute(writer, "xmlns", ns_bytestreams);
+ writer->writeAttribute("xmlns", ns_bytestreams);
helperToXmlAddAttribute(writer, "sid", m_sid);
QString modeStr;
if (m_mode == Tcp)
diff --git a/src/QXmppDataForm.cpp b/src/QXmppDataForm.cpp
index eb174940..bfce6fcb 100644
--- a/src/QXmppDataForm.cpp
+++ b/src/QXmppDataForm.cpp
@@ -360,7 +360,7 @@ void QXmppDataForm::toXml(QXmlStreamWriter *writer) const
return;
writer->writeStartElement("x");
- helperToXmlAddAttribute(writer, "xmlns", ns_data);
+ writer->writeAttribute("xmlns", ns_data);
/* form type */
QString typeStr;
diff --git a/src/QXmppDiscoveryIq.cpp b/src/QXmppDiscoveryIq.cpp
index 35b5c669..1409721e 100644
--- a/src/QXmppDiscoveryIq.cpp
+++ b/src/QXmppDiscoveryIq.cpp
@@ -263,7 +263,7 @@ void QXmppDiscoveryIq::parseElementFromChild(const QDomElement &element)
void QXmppDiscoveryIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
writer->writeStartElement("query");
- helperToXmlAddAttribute(writer, "xmlns",
+ writer->writeAttribute("xmlns",
m_queryType == InfoQuery ? ns_disco_info : ns_disco_items);
helperToXmlAddAttribute(writer, "node", m_queryNode);
diff --git a/src/QXmppElement.cpp b/src/QXmppElement.cpp
index 8499eff1..904ab473 100644
--- a/src/QXmppElement.cpp
+++ b/src/QXmppElement.cpp
@@ -213,7 +213,7 @@ void QXmppElement::toXml(QXmlStreamWriter *writer) const
writer->writeStartElement(d->name);
if (d->attributes.contains("xmlns"))
- helperToXmlAddAttribute(writer, "xmlns", d->attributes.value("xmlns"));
+ writer->writeAttribute("xmlns", d->attributes.value("xmlns"));
foreach (const QString &attr, d->attributes.keys())
if (attr != "xmlns")
helperToXmlAddAttribute(writer, attr, d->attributes.value(attr));
diff --git a/src/QXmppEntityTimeIq.cpp b/src/QXmppEntityTimeIq.cpp
index 9c8ebbb8..5e41e39f 100644
--- a/src/QXmppEntityTimeIq.cpp
+++ b/src/QXmppEntityTimeIq.cpp
@@ -79,7 +79,7 @@ void QXmppEntityTimeIq::parseElementFromChild(const QDomElement &element)
void QXmppEntityTimeIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
writer->writeStartElement("time");
- helperToXmlAddAttribute(writer, "xmlns", ns_entity_time);
+ writer->writeAttribute("xmlns", ns_entity_time);
if(m_utc.isValid())
{
diff --git a/src/QXmppJingleIq.cpp b/src/QXmppJingleIq.cpp
index fcdaa1a2..ac7abf03 100644
--- a/src/QXmppJingleIq.cpp
+++ b/src/QXmppJingleIq.cpp
@@ -210,7 +210,7 @@ void QXmppJingleIq::Content::toXml(QXmlStreamWriter *writer) const
if (!m_descriptionType.isEmpty() || !m_payloadTypes.isEmpty())
{
writer->writeStartElement("description");
- helperToXmlAddAttribute(writer, "xmlns", m_descriptionType);
+ writer->writeAttribute("xmlns", m_descriptionType);
helperToXmlAddAttribute(writer, "media", m_descriptionMedia);
foreach (const QXmppJinglePayloadType &payload, m_payloadTypes)
payload.toXml(writer);
@@ -221,7 +221,7 @@ void QXmppJingleIq::Content::toXml(QXmlStreamWriter *writer) const
if (!m_transportType.isEmpty() || !m_transportCandidates.isEmpty())
{
writer->writeStartElement("transport");
- helperToXmlAddAttribute(writer, "xmlns", m_transportType);
+ writer->writeAttribute("xmlns", m_transportType);
helperToXmlAddAttribute(writer, "ufrag", m_transportUser);
helperToXmlAddAttribute(writer, "pwd", m_transportPassword);
foreach (const QXmppJingleCandidate &candidate, m_transportCandidates)
@@ -404,7 +404,7 @@ void QXmppJingleIq::parseElementFromChild(const QDomElement &element)
void QXmppJingleIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
writer->writeStartElement("jingle");
- helperToXmlAddAttribute(writer, "xmlns", ns_jingle);
+ writer->writeAttribute("xmlns", ns_jingle);
helperToXmlAddAttribute(writer, "action", jingle_actions[m_action]);
helperToXmlAddAttribute(writer, "initiator", m_initiator);
helperToXmlAddAttribute(writer, "responder", m_responder);
@@ -416,7 +416,7 @@ void QXmppJingleIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
if (m_ringing)
{
writer->writeStartElement("ringing");
- helperToXmlAddAttribute(writer, "xmlns", ns_jingle_rtp_info);
+ writer->writeAttribute("xmlns", ns_jingle_rtp_info);
writer->writeEndElement();
}
diff --git a/src/QXmppMessage.cpp b/src/QXmppMessage.cpp
index d5278df1..89be7570 100644
--- a/src/QXmppMessage.cpp
+++ b/src/QXmppMessage.cpp
@@ -260,7 +260,7 @@ void QXmppMessage::toXml(QXmlStreamWriter *xmlWriter) const
if (m_state > None && m_state <= Paused)
{
xmlWriter->writeStartElement(chat_states[m_state]);
- helperToXmlAddAttribute(xmlWriter, "xmlns", ns_chat_states);
+ xmlWriter->writeAttribute("xmlns", ns_chat_states);
xmlWriter->writeEndElement();
}
@@ -272,13 +272,13 @@ void QXmppMessage::toXml(QXmlStreamWriter *xmlWriter) const
{
// XEP-0203: Delayed Delivery
xmlWriter->writeStartElement("delay");
- helperToXmlAddAttribute(xmlWriter, "xmlns", ns_delayed_delivery);
+ xmlWriter->writeAttribute("xmlns", ns_delayed_delivery);
helperToXmlAddAttribute(xmlWriter, "stamp", datetimeToString(utcStamp));
xmlWriter->writeEndElement();
} else {
// XEP-0091: Legacy Delayed Delivery
xmlWriter->writeStartElement("x");
- helperToXmlAddAttribute(xmlWriter, "xmlns", ns_legacy_delayed_delivery);
+ xmlWriter->writeAttribute("xmlns", ns_legacy_delayed_delivery);
helperToXmlAddAttribute(xmlWriter, "stamp", utcStamp.toString("yyyyMMddThh:mm:ss"));
xmlWriter->writeEndElement();
}
diff --git a/src/QXmppMucIq.cpp b/src/QXmppMucIq.cpp
index 5e0fe74e..0a349860 100644
--- a/src/QXmppMucIq.cpp
+++ b/src/QXmppMucIq.cpp
@@ -201,7 +201,7 @@ void QXmppMucAdminIq::parseElementFromChild(const QDomElement &element)
void QXmppMucAdminIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
writer->writeStartElement("query");
- helperToXmlAddAttribute(writer, "xmlns", ns_muc_admin);
+ writer->writeAttribute("xmlns", ns_muc_admin);
foreach (const QXmppMucAdminIq::Item &item, m_items)
item.toXml(writer);
writer->writeEndElement();
@@ -238,7 +238,7 @@ void QXmppMucOwnerIq::parseElementFromChild(const QDomElement &element)
void QXmppMucOwnerIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
writer->writeStartElement("query");
- helperToXmlAddAttribute(writer, "xmlns", ns_muc_owner);
+ writer->writeAttribute("xmlns", ns_muc_owner);
m_form.toXml(writer);
writer->writeEndElement();
}
diff --git a/src/QXmppPingIq.cpp b/src/QXmppPingIq.cpp
index 1245e320..7058c6d0 100644
--- a/src/QXmppPingIq.cpp
+++ b/src/QXmppPingIq.cpp
@@ -41,7 +41,7 @@ bool QXmppPingIq::isPingIq(const QDomElement &element)
void QXmppPingIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
writer->writeStartElement("ping");
- helperToXmlAddAttribute(writer, "xmlns", ns_ping);
+ writer->writeAttribute("xmlns", ns_ping);
writer->writeEndElement();
}
diff --git a/src/QXmppPresence.cpp b/src/QXmppPresence.cpp
index 567341b8..6fd06f6d 100644
--- a/src/QXmppPresence.cpp
+++ b/src/QXmppPresence.cpp
@@ -171,7 +171,7 @@ void QXmppPresence::toXml(QXmlStreamWriter *xmlWriter) const
if(m_vCardUpdateType != VCardUpdateNone)
{
xmlWriter->writeStartElement("x");
- helperToXmlAddAttribute(xmlWriter, "xmlns", ns_vcard_update);
+ xmlWriter->writeAttribute("xmlns", ns_vcard_update);
switch(m_vCardUpdateType)
{
case VCardUpdateNoPhoto:
@@ -192,7 +192,7 @@ void QXmppPresence::toXml(QXmlStreamWriter *xmlWriter) const
&& !m_capabilityHash.isEmpty())
{
xmlWriter->writeStartElement("c");
- helperToXmlAddAttribute(xmlWriter, "xmlns", ns_capabilities);
+ xmlWriter->writeAttribute("xmlns", ns_capabilities);
helperToXmlAddAttribute(xmlWriter, "hash", m_capabilityHash);
helperToXmlAddAttribute(xmlWriter, "node", m_capabilityNode);
helperToXmlAddAttribute(xmlWriter, "ver", m_capabilityVer.toBase64());
diff --git a/src/QXmppPubSubIq.cpp b/src/QXmppPubSubIq.cpp
index 40b568d1..1ad1c39d 100644
--- a/src/QXmppPubSubIq.cpp
+++ b/src/QXmppPubSubIq.cpp
@@ -226,7 +226,7 @@ void QXmppPubSubIq::parseElementFromChild(const QDomElement &element)
void QXmppPubSubIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
writer->writeStartElement("pubsub");
- helperToXmlAddAttribute(writer, "xmlns", ns_pubsub);
+ writer->writeAttribute("xmlns", ns_pubsub);
// write query type
writer->writeStartElement(pubsub_queries[m_queryType]);
diff --git a/src/QXmppRpcIq.cpp b/src/QXmppRpcIq.cpp
index 94a7f046..a2647077 100644
--- a/src/QXmppRpcIq.cpp
+++ b/src/QXmppRpcIq.cpp
@@ -319,7 +319,7 @@ void QXmppRpcResponseIq::parseElementFromChild(const QDomElement &element)
void QXmppRpcResponseIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
writer->writeStartElement("query");
- helperToXmlAddAttribute(writer, "xmlns", ns_rpc);
+ writer->writeAttribute("xmlns", ns_rpc);
writer->writeStartElement("methodResponse");
if (m_faultCode)
@@ -421,7 +421,7 @@ void QXmppRpcInvokeIq::parseElementFromChild(const QDomElement &element)
void QXmppRpcInvokeIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
writer->writeStartElement("query");
- helperToXmlAddAttribute(writer, "xmlns", ns_rpc);
+ writer->writeAttribute("xmlns", ns_rpc);
writer->writeStartElement("methodCall");
writer->writeTextElement("methodName", m_method);
diff --git a/src/QXmppStanza.cpp b/src/QXmppStanza.cpp
index 8ea9c1ea..effe03c9 100644
--- a/src/QXmppStanza.cpp
+++ b/src/QXmppStanza.cpp
@@ -278,14 +278,14 @@ void QXmppStanza::Error::toXml( QXmlStreamWriter *writer ) const
if(!cond.isEmpty())
{
writer->writeStartElement(cond);
- helperToXmlAddAttribute(writer,"xmlns", ns_stanza);
+ writer->writeAttribute("xmlns", ns_stanza);
writer->writeEndElement();
}
if(!m_text.isEmpty())
{
writer->writeStartElement("text");
- helperToXmlAddAttribute(writer,"xml:lang", "en");
- helperToXmlAddAttribute(writer,"xmlns", ns_stanza);
+ writer->writeAttribute("xml:lang", "en");
+ writer->writeAttribute("xmlns", ns_stanza);
writer->writeCharacters(m_text);
writer->writeEndElement();
}
diff --git a/src/QXmppStreamInitiationIq.cpp b/src/QXmppStreamInitiationIq.cpp
index c31217f7..32dd0c78 100644
--- a/src/QXmppStreamInitiationIq.cpp
+++ b/src/QXmppStreamInitiationIq.cpp
@@ -94,7 +94,7 @@ void QXmppStreamInitiationIq::parseElementFromChild(const QDomElement &element)
void QXmppStreamInitiationIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
writer->writeStartElement("si");
- helperToXmlAddAttribute(writer, "xmlns", ns_stream_initiation);
+ writer->writeAttribute("xmlns", ns_stream_initiation);
helperToXmlAddAttribute(writer, "id", m_siId);
helperToXmlAddAttribute(writer, "mime-type", m_mimeType);
if (m_profile == FileTransfer)
diff --git a/src/QXmppVCardIq.cpp b/src/QXmppVCardIq.cpp
index 996021b5..35fe74cb 100644
--- a/src/QXmppVCardIq.cpp
+++ b/src/QXmppVCardIq.cpp
@@ -264,7 +264,7 @@ void QXmppVCardIq::parseElementFromChild(const QDomElement& nodeRecv)
void QXmppVCardIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
writer->writeStartElement("vCard");
- helperToXmlAddAttribute(writer,"xmlns", ns_vcard);
+ writer->writeAttribute("xmlns", ns_vcard);
if (m_birthday.isValid())
helperToXmlAddTextElement(writer, "BDAY", m_birthday.toString("yyyy-MM-dd"));
if (!m_email.isEmpty())
diff --git a/src/QXmppVersionIq.cpp b/src/QXmppVersionIq.cpp
index 6e342699..358596b6 100644
--- a/src/QXmppVersionIq.cpp
+++ b/src/QXmppVersionIq.cpp
@@ -95,7 +95,7 @@ void QXmppVersionIq::parseElementFromChild(const QDomElement &element)
void QXmppVersionIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
{
writer->writeStartElement("query");
- helperToXmlAddAttribute(writer, "xmlns", ns_version);
+ writer->writeAttribute("xmlns", ns_version);
if (!m_name.isEmpty())
helperToXmlAddTextElement(writer, "name", m_name);