author | zautrix <zautrix> | 2004-10-29 09:03:54 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-29 09:03:54 (UTC) |
commit | 6500d6ebb080f1de58fe676aa0a730d47fcf64f5 (patch) (side-by-side diff) | |
tree | 41841e05bf1e6b88e6e55f42011dce5f6bed85b4 /kabc | |
parent | 41e3625b8c38ff45e70b59416a519d59a5f4d937 (diff) | |
download | kdepimpi-6500d6ebb080f1de58fe676aa0a730d47fcf64f5.zip kdepimpi-6500d6ebb080f1de58fe676aa0a730d47fcf64f5.tar.gz kdepimpi-6500d6ebb080f1de58fe676aa0a730d47fcf64f5.tar.bz2 |
sync fixes
-rw-r--r-- | kabc/addressbook.cpp | 24 | ||||
-rw-r--r-- | kabc/addressee.cpp | 23 |
2 files changed, 27 insertions, 20 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index 6194d6d..4c4ae09 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp @@ -564,3 +564,2 @@ void AddressBook::removeSyncInfo( QString syncProfile) Iterator it2 ; - QDateTime dt ( QDate( 2004,1,1) ); while ( it != end() ) { @@ -788,8 +787,3 @@ void AddressBook::insertAddressee( const Addressee &a, bool setRev, bool takeRes if ( setRev ) { - - // get rid of micro seconds - QDateTime dt = QDateTime::currentDateTime(); - QTime t = dt.time(); - dt.setTime( QTime (t.hour (), t.minute (), t.second () ) ); - (*it).setRevision( dt ); + (*it).setRevision( QDateTime::currentDateTime() ); } @@ -818,2 +812,3 @@ void AddressBook::insertAddressee( const Addressee &a, bool setRev, bool takeRes return; + d->mAddressees.append( a ); @@ -822,3 +817,2 @@ void AddressBook::insertAddressee( const Addressee &a, bool setRev, bool takeRes addr.setResource( standardResource() ); - addr.setChanged( true ); @@ -861,3 +855,3 @@ void AddressBook::removeSyncAddressees( bool removeDeleted ) Iterator it2 ; - QDateTime dt ( QDate( 2004,1,1) ); + QDateTime dt ( QDate( 2003,1,1) ); while ( it != end() ) { @@ -867,3 +861,3 @@ void AddressBook::removeSyncAddressees( bool removeDeleted ) (*it).removeCustom( "KADDRESSBOOK", "X-ExternalID" ); - (*it).setIDStr(""); + (*it).setIDStr(":"); } @@ -880,4 +874,2 @@ void AddressBook::removeSyncAddressees( bool removeDeleted ) (*it).setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); - - } @@ -933,3 +925,4 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID || - (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_CSUM ) { + (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_CSUM || + (*it).tempSyncStat() == SYNC_TEMPSTATE_ADDED_EXTERNAL) { Addressee ad = aBook->findByUid( ( (*it).uid() )); @@ -939,3 +932,2 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool (*it).setIDStr(":"); - (*it).computeCsum( csd ); if ( setID ) { @@ -945,4 +937,6 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool ad.setID( csd, (*it).uid() ); + (*it).computeCsum( csd ); ad.setCsum( csd, (*it).getCsum( csd ) ); - aBook->insertAddressee( ad ); + //qDebug("CSUM %s ",(*it).getCsum( csd ).latin1() ); + aBook->insertAddressee( ad , false); } diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index d5a110a..3d4992c 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp @@ -211,7 +211,7 @@ void Addressee::computeCsum(const QString &dev) QStringList l; - if ( !mData->name.isEmpty() ) l.append(mData->name); - if ( !mData->formattedName.isEmpty() ) l.append(mData->formattedName ); + //if ( !mData->name.isEmpty() ) l.append(mData->name); + //if ( !mData->formattedName.isEmpty() ) l.append(mData->formattedName ); if ( !mData->familyName.isEmpty() ) l.append( mData->familyName ); if ( !mData->givenName.isEmpty() ) l.append(mData->givenName ); - if ( !mData->additionalName ) l.append( mData->additionalName ); + if ( !mData->additionalName.isEmpty() ) l.append( mData->additionalName ); if ( !mData->prefix.isEmpty() ) l.append( mData->prefix ); @@ -258,3 +258,9 @@ void Addressee::computeCsum(const QString &dev) for ( iii = 0; iii < t.count(); ++iii) + if ( t[iii].left( 25 ) != "KADDRESSBOOK-X-ExternalID" ) { + int find = t[iii].find (':')+1; + //qDebug("lennnn %d %d ", find, t[iii].length()); + if ( find < t[iii].length()) l.append( t[iii] ); + + } KABC::Address::List::Iterator addressIter; @@ -268,3 +274,7 @@ void Addressee::computeCsum(const QString &dev) uint cs = getCsum4List(l); - //qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() ); +#if 1 + for ( iii = 0; iii < l.count(); ++iii) + qDebug("%d***%s***",iii,l[iii].latin1()); + qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() ); +#endif setCsum( dev, QString::number (cs )); @@ -1113,3 +1123,6 @@ void Addressee::setRevision( const QDateTime &revision ) mData->empty = false; - mData->revision = revision; + mData->revision = QDateTime( revision.date(), + QTime (revision.time().hour(), + revision.time().minute(), + revision.time().second())); } |