Diffstat (limited to 'kabc/plugins/sharpdtm/resourcesharpdtm.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kabc/plugins/sharpdtm/resourcesharpdtm.cpp | 57 |
1 files changed, 10 insertions, 47 deletions
diff --git a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp index bba5f9a..48d3985 100644 --- a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp +++ b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp @@ -130,5 +130,5 @@ bool ResourceSharpDTM::doOpen() mAccess = new SlZDataBase(fileName(), SlZDataBase::addressbookItems(), - NULL, true); + NULL, false); if ( !mAccess ) { @@ -140,5 +140,5 @@ bool ResourceSharpDTM::doOpen() { mConverter = new SharpDTMConverter(); - bool res = mConverter->init(); + bool res = mConverter->init(); if ( !res ) { @@ -225,17 +225,16 @@ bool ResourceSharpDTM::save( Ticket *ticket ) { KABC::Addressee addressee; - qDebug("1NEW id is %d", id); res = mConverter->sharpToAddressee( id, mAccess, addressee ); addressee.setUid((*it).uid() ); - addressee.setTempSyncStat( SYNC_TEMPSTATE_NEW_CSUM ); - changedAddressees.append( addressee ); + addressee.setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); res = mAccess->finishEditCard(&id); - qDebug("2NEW id is %d", id); + //qDebug("2NEW id is %d", id); + addressee.setExternalUID( QString::number( id ) ); + addressee.setOriginalExternalUID( QString::number( id ) ); + changedAddressees.append( addressee ); if (res == false) qDebug("Unable to append Contact: %s", addressee.formattedName().latin1()); - else { - qDebug("added card success "); - } + } else @@ -256,4 +255,5 @@ bool ResourceSharpDTM::save( Ticket *ticket ) } else if ( (*it).tempSyncStat() != SYNC_TEMPSTATE_NEW_EXTERNAL ) { //changed + qDebug("changed ****"); res = mAccess->startEditCard(id); if (res == true) @@ -270,7 +270,5 @@ bool ResourceSharpDTM::save( Ticket *ticket ) if (res == false) qDebug("Unable to append Contact: %s", addressee.formattedName().latin1()); - else { - qDebug("change card succes "); - } + } else @@ -281,40 +279,5 @@ bool ResourceSharpDTM::save( Ticket *ticket ) } } - - - - - - - - - } - -#if 0 - // old code - CardId id = 0; // 0 means new card - KABC::Addressee addressee = (*it); - - res = mAccess->startEditCard(id); - if (res == true) - { - res = mConverter->addresseeToSharp( *it, mAccess, id ); - if (res == true) - { - res = mAccess->finishEditCard(&id); - if (res == false) - qDebug("Unable to append Contact: %s", addressee.formattedName().latin1()); } - else - { - qDebug("Unable to convert Addressee: %s", addressee.formattedName().latin1()); - mAccess->cancelEditCard(); - } - } - else - { - qDebug("Unable to add new card. Addressee: %s", addressee.formattedName().latin1()); - } -#endif } |