-rw-r--r-- | libopie2/opiepim/otodo.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libopie2/opiepim/otodo.cpp b/libopie2/opiepim/otodo.cpp index 8239ba6..b3c14e6 100644 --- a/libopie2/opiepim/otodo.cpp +++ b/libopie2/opiepim/otodo.cpp | |||
@@ -33,32 +33,35 @@ struct OTodo::OTodoData : public QShared { | |||
33 | }; | 33 | }; |
34 | 34 | ||
35 | OTodo::OTodo(const OTodo &event ) | 35 | OTodo::OTodo(const OTodo &event ) |
36 | : OPimRecord( event ), data( event.data ) | 36 | : OPimRecord( event ), data( event.data ) |
37 | { | 37 | { |
38 | data->ref(); | 38 | data->ref(); |
39 | //qWarning("ref up"); | 39 | qWarning("ref up"); |
40 | } | 40 | } |
41 | OTodo::~OTodo() { | 41 | OTodo::~OTodo() { |
42 | qWarning("~OTodo " + data->sum ); | ||
42 | if ( data->deref() ) { | 43 | if ( data->deref() ) { |
43 | //qWarning("OTodo::dereffing"); | 44 | qWarning("OTodo::dereffing"); |
44 | delete data; | 45 | delete data; |
45 | data = 0l; | 46 | data = 0l; |
46 | } | 47 | } |
47 | } | 48 | } |
48 | OTodo::OTodo(bool completed, int priority, | 49 | OTodo::OTodo(bool completed, int priority, |
49 | const QArray<int> &category, | 50 | const QArray<int> &category, |
50 | const QString& summary, | 51 | const QString& summary, |
51 | const QString &description, | 52 | const QString &description, |
52 | ushort progress, | 53 | ushort progress, |
53 | bool hasDate, QDate date, int uid ) | 54 | bool hasDate, QDate date, int uid ) |
54 | : OPimRecord( uid ) | 55 | : OPimRecord( uid ) |
55 | { | 56 | { |
56 | //qWarning("OTodoData"); | 57 | qWarning("OTodoData " + summary); |
57 | setCategories( category ); | 58 | setCategories( category ); |
59 | |||
58 | data = new OTodoData; | 60 | data = new OTodoData; |
61 | |||
59 | data->date = date; | 62 | data->date = date; |
60 | data->isCompleted = completed; | 63 | data->isCompleted = completed; |
61 | data->hasDate = hasDate; | 64 | data->hasDate = hasDate; |
62 | data->priority = priority; | 65 | data->priority = priority; |
63 | data->sum = summary; | 66 | data->sum = summary; |
64 | data->prog = progress; | 67 | data->prog = progress; |
@@ -71,16 +74,18 @@ OTodo::OTodo(bool completed, int priority, | |||
71 | const QString& summary, | 74 | const QString& summary, |
72 | const QString &description, | 75 | const QString &description, |
73 | ushort progress, | 76 | ushort progress, |
74 | bool hasDate, QDate date, int uid ) | 77 | bool hasDate, QDate date, int uid ) |
75 | : OPimRecord( uid ) | 78 | : OPimRecord( uid ) |
76 | { | 79 | { |
77 | //qWarning("OTodoData"); | 80 | qWarning("OTodoData" + summary); |
78 | setCategories( idsFromString( category.join(";") ) ); | 81 | setCategories( idsFromString( category.join(";") ) ); |
82 | |||
79 | data = new OTodoData; | 83 | data = new OTodoData; |
80 | data->date = date; | 84 | data->date = date; |
85 | |||
81 | data->isCompleted = completed; | 86 | data->isCompleted = completed; |
82 | data->hasDate = hasDate; | 87 | data->hasDate = hasDate; |
83 | data->priority = priority; | 88 | data->priority = priority; |
84 | data->sum = summary; | 89 | data->sum = summary; |
85 | data->prog = progress; | 90 | data->prog = progress; |
86 | data->desc = Qtopia::simplifyMultiLineSpace(description ); | 91 | data->desc = Qtopia::simplifyMultiLineSpace(description ); |
@@ -347,13 +352,13 @@ QMap<QString, QString> OTodo::toExtraMap()const { | |||
347 | * change or modify looks at the ref count and either | 352 | * change or modify looks at the ref count and either |
348 | * creates a new QShared Object or it can modify it | 353 | * creates a new QShared Object or it can modify it |
349 | * right in place | 354 | * right in place |
350 | */ | 355 | */ |
351 | void OTodo::changeOrModify() { | 356 | void OTodo::changeOrModify() { |
352 | if ( data->count != 1 ) { | 357 | if ( data->count != 1 ) { |
353 | //qWarning("changeOrModify"); | 358 | qWarning("changeOrModify"); |
354 | data->deref(); | 359 | data->deref(); |
355 | OTodoData* d2 = new OTodoData(); | 360 | OTodoData* d2 = new OTodoData(); |
356 | copy(data, d2 ); | 361 | copy(data, d2 ); |
357 | data = d2; | 362 | data = d2; |
358 | } | 363 | } |
359 | } | 364 | } |