Changeset View
Changeset View
Standalone View
Standalone View
src/common/KReportData.cpp
Show All 12 Lines | |||||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Lesser General Public | 14 | * You should have received a copy of the GNU Lesser General Public | ||
15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | 15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | 16 | */ | ||
17 | 17 | | |||
18 | #include "KReportData.h" | 18 | #include "KReportData.h" | ||
19 | #include <QVariant> | 19 | #include <QVariant> | ||
20 | 20 | | |||
21 | KReportData::~KReportData() | 21 | class KReportData::SortedField::Private | ||
22 | { | 22 | { | ||
23 | } | 23 | | ||
24 | public: | ||||
25 | QString field; | ||||
26 | Qt::SortOrder order = Qt::AscendingOrder; | ||||
27 | }; | ||||
28 | | ||||
29 | class KReportData::Private | ||||
30 | { | ||||
31 | public: | ||||
32 | bool dummy = true; | ||||
33 | }; | ||||
34 | | ||||
35 | //==========KReportData::SortedField========== | ||||
24 | 36 | | |||
25 | KReportData::SortedField::SortedField() | 37 | KReportData::SortedField::SortedField() | ||
26 | : order(Qt::AscendingOrder) | 38 | : d(new Private()) | ||
39 | { | ||||
40 | } | ||||
41 | | ||||
42 | KReportData::SortedField::~SortedField() | ||||
43 | { | ||||
44 | delete d; | ||||
45 | } | ||||
46 | | ||||
47 | KReportData::SortedField & KReportData::SortedField::operator=(const KReportData::SortedField& other) | ||||
48 | { | ||||
49 | if (this != &other) { | ||||
50 | setField(other.field()); | ||||
51 | setOrder(other.order()); | ||||
52 | } | ||||
53 | return *this; | ||||
54 | } | ||||
55 | | ||||
56 | QString KReportData::SortedField::field() | ||||
57 | { | ||||
58 | return d->field; | ||||
59 | } | ||||
60 | | ||||
61 | QString KReportData::SortedField::field() const | ||||
62 | { | ||||
63 | return d->field; | ||||
64 | } | ||||
65 | | ||||
66 | Qt::SortOrder KReportData::SortedField::order() | ||||
67 | { | ||||
68 | return d->order; | ||||
69 | } | ||||
70 | | ||||
71 | Qt::SortOrder KReportData::SortedField::order() const | ||||
72 | { | ||||
73 | return d->order; | ||||
74 | } | ||||
75 | | ||||
76 | void KReportData::SortedField::setField(const QString& field) | ||||
77 | { | ||||
78 | d->field = field; | ||||
79 | } | ||||
80 | | ||||
81 | void KReportData::SortedField::setOrder(Qt::SortOrder order) | ||||
82 | { | ||||
83 | d->order = order; | ||||
84 | } | ||||
85 | | ||||
86 | | ||||
87 | //==========KReportData========== | ||||
88 | | ||||
89 | KReportData::KReportData() : d(new Private()) | ||||
90 | { | ||||
91 | } | ||||
92 | | ||||
93 | KReportData::~KReportData() | ||||
27 | { | 94 | { | ||
95 | delete d; | ||||
28 | } | 96 | } | ||
29 | 97 | | |||
30 | QStringList KReportData::fieldKeys() const | 98 | QStringList KReportData::fieldKeys() const | ||
31 | { | 99 | { | ||
32 | return fieldNames(); | 100 | return fieldNames(); | ||
33 | } | 101 | } | ||
34 | 102 | | |||
35 | QString KReportData::sourceName() const | 103 | QString KReportData::sourceName() const | ||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |