From 57f1b775197aed1d32e98b0299c0999339a7d5f6 Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Sun, 2 Feb 2020 18:14:27 +0100 Subject: Run clang-format also on all cpp files --- src/base/QXmppElement.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'src/base/QXmppElement.cpp') diff --git a/src/base/QXmppElement.cpp b/src/base/QXmppElement.cpp index 1e3ec7fb..9ca84d46 100644 --- a/src/base/QXmppElement.cpp +++ b/src/base/QXmppElement.cpp @@ -39,7 +39,7 @@ public: QXmppElementPrivate *parent; QMap attributes; - QList children; + QList children; QString name; QString value; @@ -63,17 +63,14 @@ QXmppElementPrivate::QXmppElementPrivate(const QDomElement &element) if (!xmlns.isEmpty() && xmlns != parentns) attributes.insert("xmlns", xmlns); QDomNamedNodeMap attrs = element.attributes(); - for (int i = 0; i < attrs.size(); i++) - { + for (int i = 0; i < attrs.size(); i++) { QDomAttr attr = attrs.item(i).toAttr(); attributes.insert(attr.name(), attr.value()); } QDomNode childNode = element.firstChild(); - while (!childNode.isNull()) - { - if (childNode.isElement()) - { + while (!childNode.isNull()) { + if (childNode.isElement()) { QXmppElementPrivate *child = new QXmppElementPrivate(childNode.toElement()); child->parent = this; children.append(child); @@ -124,7 +121,7 @@ QXmppElement::~QXmppElement() QXmppElement &QXmppElement::operator=(const QXmppElement &other) { - if (this != &other) // self-assignment check + if (this != &other) // self-assignment check { other.d->counter.ref(); if (!d->counter.deref()) @@ -140,8 +137,7 @@ QDomElement QXmppElement::sourceDomElement() const return QDomElement(); QDomDocument doc; - if (!doc.setContent(d->serializedSource, true)) - { + if (!doc.setContent(d->serializedSource, true)) { qWarning("[QXmpp] QXmppElement::sourceDomElement(): cannot parse source element"); return QDomElement(); } @@ -189,7 +185,7 @@ QXmppElement QXmppElement::nextSiblingElement(const QString &name) const { if (!d->parent) return QXmppElement(); - const QList &siblings_d = d->parent->children; + const QList &siblings_d = d->parent->children; for (int i = siblings_d.indexOf(d) + 1; i < siblings_d.size(); i++) if (name.isEmpty() || siblings_d[i]->name == name) return QXmppElement(siblings_d[i]); -- cgit v1.2.3