diff options
| author | Linus Jahn <lnj@kaidan.im> | 2020-02-02 18:14:27 +0100 |
|---|---|---|
| committer | LNJ <lnj@kaidan.im> | 2020-02-03 00:11:55 +0100 |
| commit | 57f1b775197aed1d32e98b0299c0999339a7d5f6 (patch) | |
| tree | ce5702781e15f3a5c438ab153edf06f51a501b29 /src/base/QXmppElement.cpp | |
| parent | 99b850a3008bbb03d3449d683adb87839f7d5c4b (diff) | |
| download | qxmpp-57f1b775197aed1d32e98b0299c0999339a7d5f6.tar.gz | |
Run clang-format also on all cpp files
Diffstat (limited to 'src/base/QXmppElement.cpp')
| -rw-r--r-- | src/base/QXmppElement.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
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<QString, QString> attributes; - QList<QXmppElementPrivate*> children; + QList<QXmppElementPrivate *> 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<QXmppElementPrivate*> &siblings_d = d->parent->children; + const QList<QXmppElementPrivate *> &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]); |
