author | zautrix <zautrix> | 2004-10-29 09:03:54 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-29 09:03:54 (UTC) |
commit | 6500d6ebb080f1de58fe676aa0a730d47fcf64f5 (patch) (unidiff) | |
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 | 26 | ||||
-rw-r--r-- | kabc/addressee.cpp | 25 |
2 files changed, 29 insertions, 22 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) | |||
564 | Iterator it2 ; | 564 | Iterator it2 ; |
565 | QDateTime dt ( QDate( 2004,1,1) ); | ||
566 | while ( it != end() ) { | 565 | while ( it != end() ) { |
@@ -788,8 +787,3 @@ void AddressBook::insertAddressee( const Addressee &a, bool setRev, bool takeRes | |||
788 | if ( setRev ) { | 787 | if ( setRev ) { |
789 | 788 | (*it).setRevision( QDateTime::currentDateTime() ); | |
790 | // get rid of micro seconds | ||
791 | QDateTime dt = QDateTime::currentDateTime(); | ||
792 | QTime t = dt.time(); | ||
793 | dt.setTime( QTime (t.hour (), t.minute (), t.second () ) ); | ||
794 | (*it).setRevision( dt ); | ||
795 | } | 789 | } |
@@ -817,3 +811,4 @@ void AddressBook::insertAddressee( const Addressee &a, bool setRev, bool takeRes | |||
817 | if ( found ) | 811 | if ( found ) |
818 | return; | 812 | return; |
813 | |||
819 | d->mAddressees.append( a ); | 814 | d->mAddressees.append( a ); |
@@ -822,3 +817,2 @@ void AddressBook::insertAddressee( const Addressee &a, bool setRev, bool takeRes | |||
822 | addr.setResource( standardResource() ); | 817 | addr.setResource( standardResource() ); |
823 | |||
824 | addr.setChanged( true ); | 818 | addr.setChanged( true ); |
@@ -861,3 +855,3 @@ void AddressBook::removeSyncAddressees( bool removeDeleted ) | |||
861 | Iterator it2 ; | 855 | Iterator it2 ; |
862 | QDateTime dt ( QDate( 2004,1,1) ); | 856 | QDateTime dt ( QDate( 2003,1,1) ); |
863 | while ( it != end() ) { | 857 | while ( it != end() ) { |
@@ -867,3 +861,3 @@ void AddressBook::removeSyncAddressees( bool removeDeleted ) | |||
867 | (*it).removeCustom( "KADDRESSBOOK", "X-ExternalID" ); | 861 | (*it).removeCustom( "KADDRESSBOOK", "X-ExternalID" ); |
868 | (*it).setIDStr(""); | 862 | (*it).setIDStr(":"); |
869 | } | 863 | } |
@@ -880,4 +874,2 @@ void AddressBook::removeSyncAddressees( bool removeDeleted ) | |||
880 | (*it).setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); | 874 | (*it).setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); |
881 | |||
882 | |||
883 | } | 875 | } |
@@ -933,3 +925,4 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool | |||
933 | if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID || | 925 | if ( (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_ID || |
934 | (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_CSUM ) { | 926 | (*it).tempSyncStat() == SYNC_TEMPSTATE_NEW_CSUM || |
927 | (*it).tempSyncStat() == SYNC_TEMPSTATE_ADDED_EXTERNAL) { | ||
935 | Addressee ad = aBook->findByUid( ( (*it).uid() )); | 928 | Addressee ad = aBook->findByUid( ( (*it).uid() )); |
@@ -939,3 +932,2 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool | |||
939 | (*it).setIDStr(":"); | 932 | (*it).setIDStr(":"); |
940 | (*it).computeCsum( csd ); | ||
941 | if ( setID ) { | 933 | if ( setID ) { |
@@ -945,4 +937,6 @@ void AddressBook::postExternSync( AddressBook* aBook , const QString& csd, bool | |||
945 | ad.setID( csd, (*it).uid() ); | 937 | ad.setID( csd, (*it).uid() ); |
938 | (*it).computeCsum( csd ); | ||
946 | ad.setCsum( csd, (*it).getCsum( csd ) ); | 939 | ad.setCsum( csd, (*it).getCsum( csd ) ); |
947 | aBook->insertAddressee( ad ); | 940 | //qDebug("CSUM %s ",(*it).getCsum( csd ).latin1() ); |
941 | aBook->insertAddressee( ad , false); | ||
948 | } | 942 | } |
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) | |||
211 | QStringList l; | 211 | QStringList l; |
212 | if ( !mData->name.isEmpty() ) l.append(mData->name); | 212 | //if ( !mData->name.isEmpty() ) l.append(mData->name); |
213 | if ( !mData->formattedName.isEmpty() ) l.append(mData->formattedName ); | 213 | //if ( !mData->formattedName.isEmpty() ) l.append(mData->formattedName ); |
214 | if ( !mData->familyName.isEmpty() ) l.append( mData->familyName ); | 214 | if ( !mData->familyName.isEmpty() ) l.append( mData->familyName ); |
215 | if ( !mData->givenName.isEmpty() ) l.append(mData->givenName ); | 215 | if ( !mData->givenName.isEmpty() ) l.append(mData->givenName ); |
216 | if ( !mData->additionalName ) l.append( mData->additionalName ); | 216 | if ( !mData->additionalName.isEmpty() ) l.append( mData->additionalName ); |
217 | if ( !mData->prefix.isEmpty() ) l.append( mData->prefix ); | 217 | if ( !mData->prefix.isEmpty() ) l.append( mData->prefix ); |
@@ -258,3 +258,9 @@ void Addressee::computeCsum(const QString &dev) | |||
258 | for ( iii = 0; iii < t.count(); ++iii) | 258 | for ( iii = 0; iii < t.count(); ++iii) |
259 | l.append( t[iii] ); | 259 | if ( t[iii].left( 25 ) != "KADDRESSBOOK-X-ExternalID" ) { |
260 | int find = t[iii].find (':')+1; | ||
261 | //qDebug("lennnn %d %d ", find, t[iii].length()); | ||
262 | if ( find < t[iii].length()) | ||
263 | l.append( t[iii] ); | ||
264 | |||
265 | } | ||
260 | KABC::Address::List::Iterator addressIter; | 266 | KABC::Address::List::Iterator addressIter; |
@@ -268,3 +274,7 @@ void Addressee::computeCsum(const QString &dev) | |||
268 | uint cs = getCsum4List(l); | 274 | uint cs = getCsum4List(l); |
269 | //qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() ); | 275 | #if 1 |
276 | for ( iii = 0; iii < l.count(); ++iii) | ||
277 | qDebug("%d***%s***",iii,l[iii].latin1()); | ||
278 | qDebug("CSUM computed %d %s %s", cs,QString::number (cs ).latin1(), uid().latin1() ); | ||
279 | #endif | ||
270 | setCsum( dev, QString::number (cs )); | 280 | setCsum( dev, QString::number (cs )); |
@@ -1113,3 +1123,6 @@ void Addressee::setRevision( const QDateTime &revision ) | |||
1113 | mData->empty = false; | 1123 | mData->empty = false; |
1114 | mData->revision = revision; | 1124 | mData->revision = QDateTime( revision.date(), |
1125 | QTime (revision.time().hour(), | ||
1126 | revision.time().minute(), | ||
1127 | revision.time().second())); | ||
1115 | } | 1128 | } |