-rw-r--r-- | libopie2/opiepim/otodo.cpp | 52 |
1 files changed, 38 insertions, 14 deletions
diff --git a/libopie2/opiepim/otodo.cpp b/libopie2/opiepim/otodo.cpp index 3c93838..8239ba6 100644 --- a/libopie2/opiepim/otodo.cpp +++ b/libopie2/opiepim/otodo.cpp | |||
@@ -25,5 +25,4 @@ struct OTodo::OTodoData : public QShared { | |||
25 | bool hasDate:1; | 25 | bool hasDate:1; |
26 | int priority; | 26 | int priority; |
27 | QStringList category; | ||
28 | QString desc; | 27 | QString desc; |
29 | QString sum; | 28 | QString sum; |
@@ -47,5 +46,25 @@ OTodo::~OTodo() { | |||
47 | } | 46 | } |
48 | } | 47 | } |
48 | OTodo::OTodo(bool completed, int priority, | ||
49 | const QArray<int> &category, | ||
50 | const QString& summary, | ||
51 | const QString &description, | ||
52 | ushort progress, | ||
53 | bool hasDate, QDate date, int uid ) | ||
54 | : OPimRecord( uid ) | ||
55 | { | ||
56 | //qWarning("OTodoData"); | ||
57 | setCategories( category ); | ||
58 | data = new OTodoData; | ||
59 | data->date = date; | ||
60 | data->isCompleted = completed; | ||
61 | data->hasDate = hasDate; | ||
62 | data->priority = priority; | ||
63 | data->sum = summary; | ||
64 | data->prog = progress; | ||
65 | data->desc = Qtopia::simplifyMultiLineSpace(description ); | ||
66 | data->hasAlarmDateTime = false; | ||
49 | 67 | ||
68 | } | ||
50 | OTodo::OTodo(bool completed, int priority, | 69 | OTodo::OTodo(bool completed, int priority, |
51 | const QStringList &category, | 70 | const QStringList &category, |
@@ -268,17 +287,17 @@ bool OTodo::operator>=(const OTodo &toDoEvent )const | |||
268 | bool OTodo::operator==(const OTodo &toDoEvent )const | 287 | bool OTodo::operator==(const OTodo &toDoEvent )const |
269 | { | 288 | { |
270 | if( data->priority == toDoEvent.data->priority && | 289 | if ( data->priority != toDoEvent.data->priority ) return false; |
271 | data->priority == toDoEvent.data->prog && | 290 | if ( data->priority != toDoEvent.data->prog ) return false; |
272 | data->isCompleted == toDoEvent.data->isCompleted && | 291 | if ( data->isCompleted != toDoEvent.data->isCompleted ) return false; |
273 | data->hasDate == toDoEvent.data->hasDate && | 292 | if ( data->hasDate != toDoEvent.data->hasDate ) return false; |
274 | data->date == toDoEvent.data->date && | 293 | if ( data->date != toDoEvent.data->date ) return false; |
275 | data->category == toDoEvent.data->category && | 294 | if ( data->sum != toDoEvent.data->sum ) return false; |
276 | data->sum == toDoEvent.data->sum && | 295 | if ( data->desc != toDoEvent.data->desc ) return false; |
277 | data->desc == toDoEvent.data->desc && | 296 | if ( data->hasAlarmDateTime != toDoEvent.data->hasAlarmDateTime ) |
278 | data->hasAlarmDateTime == toDoEvent.data->hasAlarmDateTime && | 297 | return false; |
279 | data->alarmDateTime == toDoEvent.data->alarmDateTime ) | 298 | if ( data->alarmDateTime != toDoEvent.data->alarmDateTime ) |
280 | return true; | 299 | return false; |
281 | 300 | ||
282 | return false; | 301 | return OPimRecord::operator==( toDoEvent ); |
283 | } | 302 | } |
284 | void OTodo::deref() { | 303 | void OTodo::deref() { |
@@ -351,4 +370,9 @@ void OTodo::copy( OTodoData* src, OTodoData* dest ) { | |||
351 | dest->alarmDateTime = src->alarmDateTime; | 370 | dest->alarmDateTime = src->alarmDateTime; |
352 | } | 371 | } |
353 | 372 | QString OTodo::type() const { | |
373 | return QString::fromLatin1("OTodo"); | ||
374 | } | ||
375 | QString OTodo::recordField(int id )const { | ||
376 | return QString::null; | ||
377 | } | ||
354 | 378 | ||