summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2004-09-18 22:33:39 (UTC)
committer zautrix <zautrix>2004-09-18 22:33:39 (UTC)
commitf370d0f89bcaeeb68bd60152a9812a9cd55e5d8a (patch) (unidiff)
treec1a9de8b305200a7cec885764a0afb4beb92dabb /kaddressbook
parent28f894fd2a0dfbd5f09f9e530f359981efe0198c (diff)
downloadkdepimpi-f370d0f89bcaeeb68bd60152a9812a9cd55e5d8a.zip
kdepimpi-f370d0f89bcaeeb68bd60152a9812a9cd55e5d8a.tar.gz
kdepimpi-f370d0f89bcaeeb68bd60152a9812a9cd55e5d8a.tar.bz2
more AB sync
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp36
1 files changed, 32 insertions, 4 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index cc8eb52..8776b53 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -2671,4 +2671,4 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
2671 Addressee addresseeLSync; 2671 Addressee addresseeLSync;
2672 KABC::Addressee::List addresseeRSyncSharp = remote->getExternLastSyncAddressees(); 2672 // KABC::Addressee::List addresseeRSyncSharp = remote->getExternLastSyncAddressees();
2673 KABC::Addressee::List addresseeLSyncSharp = local->getExternLastSyncAddressees(); 2673 //KABC::Addressee::List addresseeLSyncSharp = local->getExternLastSyncAddressees();
2674 bool fullDateRange = false; 2674 bool fullDateRange = false;
@@ -2711,3 +2711,3 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
2711 } 2711 }
2712 fullDateRange = true; // debug only! 2712 // fullDateRange = true; // debug only!
2713 if ( fullDateRange ) 2713 if ( fullDateRange )
@@ -2920,3 +2920,29 @@ bool KABCore::syncAB(QString filename, int mode)
2920 qDebug("AB loaded %s mode %d",filename.latin1(), mode ); 2920 qDebug("AB loaded %s mode %d",filename.latin1(), mode );
2921 AddressBook::Iterator it; 2921 bool external = false;
2922 Addressee lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice );
2923 if ( ! lse.isEmpty() ) {
2924 if ( lse.familyName().left(4) == "!E: " )
2925 external = true;
2926 } else {
2927 bool found = false;
2928 QDateTime dt( QDate( 2004,1,1));
2929 AddressBook::Iterator it;
2930 for ( it = abLocal.begin(); it != abLocal.end(); ++it ) {
2931 if ( (*it).revision() != dt ) {
2932 found = true;
2933 break;
2934 }
2935 }
2936 external = ! found;
2937 }
2938
2939 if ( external ) {
2940 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
2941 AddressBook::Iterator it;
2942 for ( it = abLocal.begin(); it != abLocal.end(); ++it ) {
2943 (*it).setID( mCurrentSyncDevice, (*it).uid() );
2944 (*it).computeCsum( mCurrentSyncDevice );
2945 }
2946 }
2947 //AddressBook::Iterator it;
2922 //QStringList vcards; 2948 //QStringList vcards;
@@ -2929,2 +2955,4 @@ bool KABCore::syncAB(QString filename, int mode)
2929 { 2955 {
2956 if ( external )
2957 abLocal.removeDeletedAddressees();
2930 qDebug("saving remote AB "); 2958 qDebug("saving remote AB ");