File indexing completed on 2024-04-21 04:01:04

0001 /*
0002     This file is part of the syndication library
0003     SPDX-FileCopyrightText: 2005 Frank Osterfeld <osterfeld@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #include "source.h"
0009 #include "tools.h"
0010 
0011 #include <QString>
0012 
0013 namespace Syndication
0014 {
0015 namespace RSS2
0016 {
0017 Source::Source()
0018     : ElementWrapper()
0019 {
0020 }
0021 
0022 Source::Source(const QDomElement &element)
0023     : ElementWrapper(element)
0024 {
0025 }
0026 
0027 QString Source::source() const
0028 {
0029     return text();
0030 }
0031 
0032 QString Source::url() const
0033 {
0034     return attribute(QStringLiteral("url"));
0035 }
0036 
0037 QString Source::debugInfo() const
0038 {
0039     QString info = QLatin1String("### Source: ###################\n");
0040     if (!source().isNull()) {
0041         info += QLatin1String("source: #") + source() + QLatin1String("#\n");
0042     }
0043     if (!url().isNull()) {
0044         info += QLatin1String("url: #") + url() + QLatin1String("#\n");
0045     }
0046     info += QLatin1String("### Source end ################\n");
0047     return info;
0048 }
0049 
0050 } // namespace RSS2
0051 } // namespace Syndication