34 using namespace KCalCore;
38 const KDateTime d1= e1->dtStart();
39 KDateTime::Comparison res = d1.compare(e2->dtStart());
40 if (res == KDateTime::Equal) {
41 return Events::summaryLessThan(e1, e2);
43 return (res & KDateTime::Before || res & KDateTime::AtStart);
49 const KDateTime d1= e1->dtStart();
50 KDateTime::Comparison res = d1.compare(e2->dtStart());
51 if (res == KDateTime::Equal) {
52 return Events::summaryMoreThan(e1, e2);
54 return (res & KDateTime::After || res & KDateTime::AtEnd);
60 return QString::compare(e1->summary(), e2->summary(), Qt::CaseInsensitive) < 0;
65 return QString::compare(e1->summary(), e2->summary(), Qt::CaseInsensitive) > 0;
70 const KDateTime d1= e1->dtEnd();
71 KDateTime::Comparison res = d1.compare(e2->dtEnd());
72 if (res == KDateTime::Equal) {
73 return Events::summaryLessThan(e1, e2);
75 return (res & KDateTime::Before || res & KDateTime::AtStart);
81 const KDateTime d1= e1->dtEnd();
82 KDateTime::Comparison res = d1.compare(e2->dtEnd());
83 if (res == KDateTime::Equal) {
84 return Events::summaryMoreThan(e1, e2);
86 return (res & KDateTime::After || res & KDateTime::AtEnd);
92 const KDateTime d1 = j1->dtStart();
93 KDateTime::Comparison res = d1.compare(j2->dtStart());
94 return (res & KDateTime::Before || res & KDateTime::AtStart);
99 const KDateTime d1= j1->dtStart();
100 KDateTime::Comparison res = d1.compare(j2->dtStart());
101 return (res & KDateTime::After || res & KDateTime::AtEnd);
107 return QString::compare(j1->summary(), j2->summary(), Qt::CaseInsensitive) < 0;
112 return QString::compare(j1->summary(), j2->summary(), Qt::CaseInsensitive) > 0;
117 const KDateTime d1= t1->dtStart();
118 KDateTime::Comparison res = d1.compare(t2->dtStart());
119 if (res == KDateTime::Equal) {
120 return Todos::summaryLessThan(t1, t2);
122 return (res & KDateTime::Before || res & KDateTime::AtStart);
128 const KDateTime d1= t1->dtStart();
129 KDateTime::Comparison res = d1.compare(t2->dtStart());
130 if (res == KDateTime::Equal) {
131 return Todos::summaryMoreThan(t1, t2);
133 return (res & KDateTime::After || res & KDateTime::AtEnd);
139 const KDateTime d1= t1->dtDue();
140 KDateTime::Comparison res = d1.compare(t2->dtDue());
141 if (res == KDateTime::Equal) {
142 return Todos::summaryLessThan(t1, t2);
144 return (res & KDateTime::Before || res & KDateTime::AtStart);
150 const KDateTime d1= t1->dtDue();
151 KDateTime::Comparison res = d1.compare(t2->dtDue());
152 if (res == KDateTime::Equal) {
153 return Todos::summaryMoreThan(t1, t2);
155 return (res & KDateTime::After || res & KDateTime::AtEnd);
161 if (t1->priority() < t2->priority()) {
163 }
else if (t1->priority() == t2->priority()) {
164 return Todos::summaryLessThan(t1, t2);
172 if (t1->priority() > t2->priority()) {
174 }
else if (t1->priority() == t2->priority()) {
175 return Todos::summaryMoreThan(t1, t2);
183 if (t1->percentComplete() < t2->percentComplete()) {
185 }
else if (t1->percentComplete() == t2->percentComplete()) {
186 return Todos::summaryLessThan(t1, t2);
194 if (t1->percentComplete() > t2->percentComplete()) {
196 }
else if (t1->percentComplete() == t2->percentComplete()) {
197 return Todos::summaryMoreThan(t1, t2);
205 return QString::compare(t1->summary(), t2->summary(), Qt::CaseInsensitive) < 0;
210 return QString::compare(t1->summary(), t2->summary(), Qt::CaseInsensitive) > 0;
215 const KDateTime d1= t1->created();
216 KDateTime::Comparison res = d1.compare(t2->created());
217 if (res == KDateTime::Equal) {
218 return Todos::summaryLessThan(t1, t2);
220 return (res & KDateTime::Before || res & KDateTime::AtStart);
226 const KDateTime d1= t1->created();
227 KDateTime::Comparison res = d1.compare(t2->created());
228 if (res == KDateTime::Equal) {
229 return Todos::summaryMoreThan(t1, t2);
231 return (res & KDateTime::After || res & KDateTime::AtEnd);
241 KDateTime::Comparison res = d1.compare(d2);
242 if (res == KDateTime::Equal) {
243 return Incidences::summaryLessThan(i1, i2);
245 return (res & KDateTime::Before || res & KDateTime::AtStart);
255 KDateTime::Comparison res = d1.compare(d2);
256 if (res == KDateTime::Equal) {
257 return Incidences::summaryMoreThan(i1, i2);
259 return (res & KDateTime::After || res & KDateTime::AtEnd);
263 bool KCalCore::Incidences::createdLessThan(
const Incidence::Ptr &i1,
266 const KDateTime d1= i1->created();
267 KDateTime::Comparison res = d1.compare(i2->created());
268 if (res == KDateTime::Equal) {
269 return Incidences::summaryLessThan(i1, i2);
271 return (res & KDateTime::Before || res & KDateTime::AtStart);
275 bool KCalCore::Incidences::createdMoreThan(
const Incidence::Ptr &i1,
278 const KDateTime d1= i1->created();
279 KDateTime::Comparison res = d1.compare(i2->created());
280 if (res == KDateTime::Equal) {
281 return Incidences::summaryMoreThan(i1, i2);
283 return (res & KDateTime::After || res & KDateTime::AtEnd);
287 bool KCalCore::Incidences::summaryLessThan(
const Incidence::Ptr &i1,
290 return QString::compare(i1->summary(), i2->summary(), Qt::CaseInsensitive) < 0;
293 bool KCalCore::Incidences::summaryMoreThan(
const Incidence::Ptr &i1,
296 return QString::compare(i1->summary(), i2->summary(), Qt::CaseInsensitive) > 0;
301 return p1->count() > p2->count();
QSharedPointer< Event > Ptr
A shared pointer to an Event object.
QSharedPointer< Incidence > Ptr
A shared pointer to an Incidence.
This file is part of the API for handling calendar data and defines the Todo class.
Role for an incidence's date/time used when sorting.
This file is part of the API for handling calendar data and defines the Journal class.
QSharedPointer< Person > Ptr
A shared pointer to a Person object.
This file is part of the API for handling calendar data and defines the Event class.
QSharedPointer< Todo > Ptr
A shared pointer to a Todo object.
QSharedPointer< Journal > Ptr
A shared pointer to a Journal object.