Line data Source code
1 : #include "RawFeed.h"
2 : #include <QString>
3 : #include <QTextStream>
4 : #include <QDebug>
5 :
6 103 : RawFeed::RawFeed(QObject *parent) :
7 : FangObject(parent),
8 103 : title(""),
9 103 : subtitle(""),
10 103 : url(),
11 103 : lastUpdated(),
12 103 : minutesToUpdate(0),
13 103 : siteURL(),
14 103 : imageURL(),
15 206 : items()
16 : {
17 103 : }
18 :
19 178 : RawFeed::~RawFeed()
20 : {
21 178 : }
22 :
23 0 : QString RawFeed::toString()
24 : {
25 0 : QString ret;
26 0 : QTextStream output(&ret);
27 0 : output << "Title: " << title << Qt::endl;
28 0 : output << "Subtitle: " << subtitle << Qt::endl;
29 0 : output << "url: " << url.url() << Qt::endl;
30 0 : output << "lastUpdated: " << lastUpdated.toString() << Qt::endl;
31 0 : output << "minutesToUpdate: " << minutesToUpdate << Qt::endl;
32 0 : output << Qt::endl;
33 :
34 0 : for (RawNews* item : items) {
35 0 : output << "title: " << item->title << Qt::endl;
36 0 : output << "author: " << item->author << Qt::endl;
37 0 : output << "description: " << item->description << Qt::endl;
38 0 : output << "url: " << item->url.toString() << Qt::endl;
39 0 : output << Qt::endl;
40 : }
41 :
42 0 : return ret;
43 0 : }
|