diff options
Diffstat (limited to 'launcher/news/NewsEntry.cpp')
-rw-r--r-- | launcher/news/NewsEntry.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/launcher/news/NewsEntry.cpp b/launcher/news/NewsEntry.cpp index cfe07e86..cf6d3e46 100644 --- a/launcher/news/NewsEntry.cpp +++ b/launcher/news/NewsEntry.cpp @@ -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; } - |