-rw-r--r-- | libopie/pim/otodo.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie/pim/otodo.cpp b/libopie/pim/otodo.cpp index b4d4aa9..049359e 100644 --- a/libopie/pim/otodo.cpp +++ b/libopie/pim/otodo.cpp | |||
@@ -319,48 +319,50 @@ bool OTodo::operator==(const OTodo &toDoEvent )const | |||
319 | { | 319 | { |
320 | if ( data->priority != toDoEvent.data->priority ) return false; | 320 | if ( data->priority != toDoEvent.data->priority ) return false; |
321 | if ( data->priority != toDoEvent.data->prog ) return false; | 321 | if ( data->priority != toDoEvent.data->prog ) return false; |
322 | if ( data->isCompleted != toDoEvent.data->isCompleted ) return false; | 322 | if ( data->isCompleted != toDoEvent.data->isCompleted ) return false; |
323 | if ( data->hasDate != toDoEvent.data->hasDate ) return false; | 323 | if ( data->hasDate != toDoEvent.data->hasDate ) return false; |
324 | if ( data->date != toDoEvent.data->date ) return false; | 324 | if ( data->date != toDoEvent.data->date ) return false; |
325 | if ( data->sum != toDoEvent.data->sum ) return false; | 325 | if ( data->sum != toDoEvent.data->sum ) return false; |
326 | if ( data->desc != toDoEvent.data->desc ) return false; | 326 | if ( data->desc != toDoEvent.data->desc ) return false; |
327 | if ( data->maintainer != toDoEvent.data->maintainer ) | 327 | if ( data->maintainer != toDoEvent.data->maintainer ) |
328 | return false; | 328 | return false; |
329 | 329 | ||
330 | return OPimRecord::operator==( toDoEvent ); | 330 | return OPimRecord::operator==( toDoEvent ); |
331 | } | 331 | } |
332 | void OTodo::deref() { | 332 | void OTodo::deref() { |
333 | 333 | ||
334 | // qWarning("deref in ToDoEvent"); | 334 | // qWarning("deref in ToDoEvent"); |
335 | if ( data->deref() ) { | 335 | if ( data->deref() ) { |
336 | // qWarning("deleting"); | 336 | // qWarning("deleting"); |
337 | delete data; | 337 | delete data; |
338 | data= 0; | 338 | data= 0; |
339 | } | 339 | } |
340 | } | 340 | } |
341 | OTodo &OTodo::operator=(const OTodo &item ) | 341 | OTodo &OTodo::operator=(const OTodo &item ) |
342 | { | 342 | { |
343 | if ( *this == item ) return *this; | ||
344 | |||
343 | OPimRecord::operator=( item ); | 345 | OPimRecord::operator=( item ); |
344 | //qWarning("operator= ref "); | 346 | //qWarning("operator= ref "); |
345 | item.data->ref(); | 347 | item.data->ref(); |
346 | deref(); | 348 | deref(); |
347 | data = item.data; | 349 | data = item.data; |
348 | 350 | ||
349 | return *this; | 351 | return *this; |
350 | } | 352 | } |
351 | 353 | ||
352 | QMap<int, QString> OTodo::toMap() const { | 354 | QMap<int, QString> OTodo::toMap() const { |
353 | QMap<int, QString> map; | 355 | QMap<int, QString> map; |
354 | 356 | ||
355 | map.insert( Uid, QString::number( uid() ) ); | 357 | map.insert( Uid, QString::number( uid() ) ); |
356 | map.insert( Category, idsToString( categories() ) ); | 358 | map.insert( Category, idsToString( categories() ) ); |
357 | map.insert( HasDate, QString::number( data->hasDate ) ); | 359 | map.insert( HasDate, QString::number( data->hasDate ) ); |
358 | map.insert( Completed, QString::number( data->isCompleted ) ); | 360 | map.insert( Completed, QString::number( data->isCompleted ) ); |
359 | map.insert( Description, data->desc ); | 361 | map.insert( Description, data->desc ); |
360 | map.insert( Summary, data->sum ); | 362 | map.insert( Summary, data->sum ); |
361 | map.insert( Priority, QString::number( data->priority ) ); | 363 | map.insert( Priority, QString::number( data->priority ) ); |
362 | map.insert( DateDay, QString::number( data->date.day() ) ); | 364 | map.insert( DateDay, QString::number( data->date.day() ) ); |
363 | map.insert( DateMonth, QString::number( data->date.month() ) ); | 365 | map.insert( DateMonth, QString::number( data->date.month() ) ); |
364 | map.insert( DateYear, QString::number( data->date.year() ) ); | 366 | map.insert( DateYear, QString::number( data->date.year() ) ); |
365 | map.insert( Progress, QString::number( data->prog ) ); | 367 | map.insert( Progress, QString::number( data->prog ) ); |
366 | // map.insert( CrossReference, crossToString() ); | 368 | // map.insert( CrossReference, crossToString() ); |