1 | /* |
2 | This file is part of the syndication library |
3 | SPDX-FileCopyrightText: 2005 Frank Osterfeld <osterfeld@kde.org> |
4 | |
5 | SPDX-License-Identifier: LGPL-2.0-or-later |
6 | */ |
7 | |
8 | #include "source.h" |
9 | #include "tools.h" |
10 | |
11 | #include <QString> |
12 | |
13 | namespace Syndication |
14 | { |
15 | namespace RSS2 |
16 | { |
17 | Source::() |
18 | : ElementWrapper() |
19 | { |
20 | } |
21 | |
22 | Source::(const QDomElement &element) |
23 | : ElementWrapper(element) |
24 | { |
25 | } |
26 | |
27 | QString Source::() const |
28 | { |
29 | return text(); |
30 | } |
31 | |
32 | QString Source::() const |
33 | { |
34 | return attribute(QStringLiteral("url" )); |
35 | } |
36 | |
37 | QString Source::() const |
38 | { |
39 | QString info = QLatin1String("### Source: ###################\n" ); |
40 | if (!source().isNull()) { |
41 | info += QLatin1String("source: #" ) + source() + QLatin1String("#\n" ); |
42 | } |
43 | if (!url().isNull()) { |
44 | info += QLatin1String("url: #" ) + url() + QLatin1String("#\n" ); |
45 | } |
46 | info += QLatin1String("### Source end ################\n" ); |
47 | return info; |
48 | } |
49 | |
50 | } // namespace RSS2 |
51 | } // namespace Syndication |
52 | |