-rw-r--r-- | libkcal/phoneformat.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp index ef69bce..6d0da5c 100644 --- a/libkcal/phoneformat.cpp +++ b/libkcal/phoneformat.cpp @@ -274,10 +274,8 @@ ulong PhoneFormat::getCsum( const QStringList & attList) add = add * mul *ii*ii*ii; cSum += add; } } - if ( i == 0 ) - qDebug("csum: i == 0 %d ", cSum); } QString dump = attList.join(","); qDebug("csum: %d %s", cSum,dump.latin1()); @@ -466,15 +464,14 @@ void PhoneFormat::copyTodo( Todo* to, Todo* from ) void PhoneFormat::afterSave( Incidence* inc) { uint csum; inc->removeID( mProfileName ); -#if 0 if ( inc->type() == "Event") csum = PhoneFormat::getCsumEvent( (Event*) inc ); else csum = PhoneFormat::getCsumTodo( (Todo*) inc ); inc->setCsum( mProfileName, QString::number( csum )); -#endif + inc->setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); } bool PhoneFormat::save( Calendar *calendar) @@ -513,8 +510,12 @@ bool PhoneFormat::save( Calendar *calendar) Todo* to = tl.first(); while ( to ) { if ( to->tempSyncStat() == SYNC_TEMPSTATE_DELETE ) { calendar->deleteTodo( to ); + } else { + if ( to->isCompleted()) { + calendar->deleteTodo( to ); + } } to = tl.next(); } // 3 save file @@ -562,9 +563,9 @@ bool PhoneFormat::save( Calendar *calendar) qApp->processEvents(); uint csum; csum = PhoneFormat::getCsumEvent( ev ); QString cSum = QString::number( csum ); - ev->setCsum( mProfileName, cSum ); + //ev->setCsum( mProfileName, cSum ); //qDebug("Event cSum %s ", cSum.latin1()); ev1 = er1.first(); while ( ev1 ) { if ( ev1->getCsum( mProfileName ) == cSum ) { @@ -598,9 +599,9 @@ bool PhoneFormat::save( Calendar *calendar) qApp->processEvents(); uint csum; csum = PhoneFormat::getCsumTodo( to ); QString cSum = QString::number( csum ); - to->setCsum( mProfileName, cSum ); + //to->setCsum( mProfileName, cSum ); qDebug("Todo cSum %s ", cSum.latin1()); Todo* to1 = tl1.first(); while ( to1 ) { if ( to1->getCsum( mProfileName ) == cSum ) { |