summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-28 11:37:28 (UTC)
committer zautrix <zautrix>2004-10-28 11:37:28 (UTC)
commitaf21c3d45173ece8492850b8c2c5019e7c25d59c (patch) (side-by-side diff)
tree52e60b226372bbe37987df07495b02de321410fe
parent01cd4ef94b8604532181c390e9abd560aebaf372 (diff)
downloadkdepimpi-af21c3d45173ece8492850b8c2c5019e7c25d59c.zip
kdepimpi-af21c3d45173ece8492850b8c2c5019e7c25d59c.tar.gz
kdepimpi-af21c3d45173ece8492850b8c2c5019e7c25d59c.tar.bz2
dtm sync fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp14
-rw-r--r--korganizer/calendarview.cpp10
2 files changed, 15 insertions, 9 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index bdc5bd8..c75b4bc 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -2636,7 +2636,7 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
//qDebug("take %d %s ", take, inL.summary().latin1());
if ( take == 3 )
return false;
- if ( take == 1 ) {// take local
+ if ( take == 1 ) {// take local **********************
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) );
inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) );
@@ -2661,7 +2661,7 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
inR.setResource( 0 );
remote->insertAddressee( inR , false);
++changedRemote;
- } else { // take == 2 take remote
+ } else { // take == 2 take remote **********************
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
if ( inR.revision().date().year() < 2004 )
inR.setRevision( modifiedCalendar );
@@ -2680,7 +2680,7 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
}
}
}
- } else { // no conflict
+ } else { // no conflict ********** add or delete remote
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
QString des = addresseeLSync.note();
if ( des.find( inR.getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it
@@ -2690,7 +2690,10 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
} else {
inR.setRevision( modifiedCalendar );
remote->insertAddressee( inR, false );
- inL = inR;
+ inL = inR;
+ inL.setIDStr( ":" );
+ inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) );
+ inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) );
inL.setResource( 0 );
local->insertAddressee( inL , false);
++addedAddressee;
@@ -2732,7 +2735,7 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
inL = local->findByUid( uid );
if ( !inL.resource() || inL.resource()->includeInSync() ) {
inR = remote->findByUid( uid );
- if ( inR.isEmpty() ) {
+ if ( inR.isEmpty() ) { / no conflict ********** add or delete local
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
// pending checkExternSyncAddressee(addresseeLSyncSharp, inL);
@@ -2761,6 +2764,7 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo
inL.setRevision( modifiedCalendar );
local->insertAddressee( inL, false );
inR = inL;
+ inR.setIDStr( ":" );
inR.setResource( 0 );
remote->insertAddressee( inR, false );
}
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 4667918..4e29d6f 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1016,7 +1016,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
//qDebug("take %d %s ", take, inL->summary().latin1());
if ( take == 3 )
return false;
- if ( take == 1 ) {// take local
+ if ( take == 1 ) {// take local **********************
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL )
inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
else
@@ -1030,7 +1030,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
if ( mSyncManager->syncWithDesktop() )
inR->setPilotId( 2 );
++changedRemote;
- } else {
+ } else {// take remote **********************
idS = inL->IDStr();
int pid = inL->pilotId();
local->deleteIncidence( inL );
@@ -1046,7 +1046,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
++changedLocal;
}
}
- } else { // no conflict
+ } else { // no conflict ********** add or delete remote
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
QString des = eventLSync->description();
QString pref = "e";
@@ -1060,6 +1060,8 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
inR->setLastModified( modifiedCalendar );
inL = inR->clone();
inL->setIDStr( ":" );
+ inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
+ inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) );
local->addIncidence( inL );
++addedEvent;
}
@@ -1104,7 +1106,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
skipIncidence = true;
if ( !skipIncidence ) {
inR = remote->incidence( uid );
- if ( ! inR ) {
+ if ( ! inR ) { // no conflict ********** add or delete local
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
checkExternSyncEvent(eventLSyncSharp, inL);