Line data Source code
1 : #include "RawNews.h"
2 :
3 1949 : RawNews::RawNews(QObject *parent) :
4 : FangObject(parent),
5 1949 : title(""),
6 1949 : author(""),
7 1949 : description(""),
8 1949 : timestamp(),
9 1949 : url(),
10 1949 : guid(""),
11 3898 : dbId(-1)
12 : {
13 1949 : }
14 :
15 0 : bool RawNews::operator<(const RawNews& right) {
16 0 : return LessThan(this, &right);
17 : }
18 :
19 0 : bool RawNews::LessThan(const RawNews *left, const RawNews *right)
20 : {
21 : // Use title if dates are equal.
22 0 : if (left->timestamp == right->timestamp)
23 0 : return left->title < right->title;
24 :
25 : // Sort on timestamp.
26 0 : return left->timestamp < right->timestamp;
27 : }
28 :
29 0 : bool RawNews::GreaterThan(const RawNews *left, const RawNews *right)
30 : {
31 0 : return !LessThan(left, right);
32 : }
|