author | zecke <zecke> | 2002-09-21 15:02:50 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-09-21 15:02:50 (UTC) |
commit | e6c53c4d7317e766235449535b22d0d2fe709214 (patch) (unidiff) | |
tree | c210c639611acd5aa3c1863451fb4e31ac3af29a /libopie/pim/otodo.cpp | |
parent | fe0806def8ec79815832193fe402c75361108622 (diff) | |
download | opie-e6c53c4d7317e766235449535b22d0d2fe709214.zip opie-e6c53c4d7317e766235449535b22d0d2fe709214.tar.gz opie-e6c53c4d7317e766235449535b22d0d2fe709214.tar.bz2 |
Some more implementation
in OPimRecord::setUid
ORecordList implemented never compiled it though
OTodo a new c'tor and some more changes
-rw-r--r-- | libopie/pim/otodo.cpp | 52 |
1 files changed, 38 insertions, 14 deletions
diff --git a/libopie/pim/otodo.cpp b/libopie/pim/otodo.cpp index 3c93838..8239ba6 100644 --- a/libopie/pim/otodo.cpp +++ b/libopie/pim/otodo.cpp | |||
@@ -23,9 +23,8 @@ struct OTodo::OTodoData : public QShared { | |||
23 | QDate date; | 23 | QDate date; |
24 | bool isCompleted:1; | 24 | bool isCompleted:1; |
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; |
30 | QMap<QString, QString> extra; | 29 | QMap<QString, QString> extra; |
31 | ushort prog; | 30 | ushort prog; |
@@ -45,9 +44,29 @@ OTodo::~OTodo() { | |||
45 | delete data; | 44 | delete data; |
46 | data = 0l; | 45 | data = 0l; |
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, |
52 | const QString& summary, | 71 | const QString& summary, |
53 | const QString &description, | 72 | const QString &description, |
@@ -266,21 +285,21 @@ bool OTodo::operator>=(const OTodo &toDoEvent )const | |||
266 | return true; | 285 | return true; |
267 | } | 286 | } |
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; | ||
281 | |||
282 | return false; | 299 | return false; |
300 | |||
301 | return OPimRecord::operator==( toDoEvent ); | ||
283 | } | 302 | } |
284 | void OTodo::deref() { | 303 | void OTodo::deref() { |
285 | 304 | ||
286 | //qWarning("deref in ToDoEvent"); | 305 | //qWarning("deref in ToDoEvent"); |
@@ -349,6 +368,11 @@ void OTodo::copy( OTodoData* src, OTodoData* dest ) { | |||
349 | dest->prog = src->prog; | 368 | dest->prog = src->prog; |
350 | dest->hasAlarmDateTime = src->hasAlarmDateTime; | 369 | dest->hasAlarmDateTime = src->hasAlarmDateTime; |
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 | ||