chore: reformat

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu
2023-08-02 18:35:35 +02:00
parent ce2ca13815
commit 1d468ac35a
594 changed files with 16040 additions and 16536 deletions

View File

@ -18,16 +18,14 @@
#include <QDomNodeList>
#include <QVariant>
NewsEntry::NewsEntry(QObject* parent) :
QObject(parent)
NewsEntry::NewsEntry(QObject* parent) : QObject(parent)
{
this->title = tr("Untitled");
this->content = tr("No content.");
this->link = "";
}
NewsEntry::NewsEntry(const QString& title, const QString& content, const QString& link, QObject* parent) :
QObject(parent)
NewsEntry::NewsEntry(const QString& title, const QString& content, const QString& link, QObject* parent) : QObject(parent)
{
this->title = title;
this->content = content;
@ -37,16 +35,13 @@ NewsEntry::NewsEntry(const QString& title, const QString& content, const QString
/*!
* Gets the text content of the given child element as a QVariant.
*/
inline QString childValue(const QDomElement& element, const QString& childName, QString defaultVal="")
inline QString childValue(const QDomElement& element, const QString& childName, QString defaultVal = "")
{
QDomNodeList nodes = element.elementsByTagName(childName);
if (nodes.count() > 0)
{
if (nodes.count() > 0) {
QDomElement element = nodes.at(0).toElement();
return element.text();
}
else
{
} else {
return defaultVal;
}
}
@ -62,4 +57,3 @@ bool NewsEntry::fromXmlElement(const QDomElement& element, NewsEntry* entry, QSt
entry->link = link;
return true;
}