summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2004-10-28 11:37:28 (UTC)
committer zautrix <zautrix>2004-10-28 11:37:28 (UTC)
commitaf21c3d45173ece8492850b8c2c5019e7c25d59c (patch) (unidiff)
tree52e60b226372bbe37987df07495b02de321410fe /korganizer
parent01cd4ef94b8604532181c390e9abd560aebaf372 (diff)
downloadkdepimpi-af21c3d45173ece8492850b8c2c5019e7c25d59c.zip
kdepimpi-af21c3d45173ece8492850b8c2c5019e7c25d59c.tar.gz
kdepimpi-af21c3d45173ece8492850b8c2c5019e7c25d59c.tar.bz2
dtm sync fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 4667918..4e29d6f 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1013,13 +1013,13 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1013 inL = local->incidence( uid ); 1013 inL = local->incidence( uid );
1014 if ( inL ) { // maybe conflict - same uid in both calendars 1014 if ( inL ) { // maybe conflict - same uid in both calendars
1015 if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { 1015 if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) {
1016 //qDebug("take %d %s ", take, inL->summary().latin1()); 1016 //qDebug("take %d %s ", take, inL->summary().latin1());
1017 if ( take == 3 ) 1017 if ( take == 3 )
1018 return false; 1018 return false;
1019 if ( take == 1 ) {// take local 1019 if ( take == 1 ) {// take local **********************
1020 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) 1020 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL )
1021 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1021 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1022 else 1022 else
1023 idS = inR->IDStr(); 1023 idS = inR->IDStr();
1024 remote->deleteIncidence( inR ); 1024 remote->deleteIncidence( inR );
1025 inR = inL->clone(); 1025 inR = inL->clone();
@@ -1027,13 +1027,13 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1027 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) 1027 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL )
1028 inR->setIDStr( idS ); 1028 inR->setIDStr( idS );
1029 remote->addIncidence( inR ); 1029 remote->addIncidence( inR );
1030 if ( mSyncManager->syncWithDesktop() ) 1030 if ( mSyncManager->syncWithDesktop() )
1031 inR->setPilotId( 2 ); 1031 inR->setPilotId( 2 );
1032 ++changedRemote; 1032 ++changedRemote;
1033 } else { 1033 } else {// take remote **********************
1034 idS = inL->IDStr(); 1034 idS = inL->IDStr();
1035 int pid = inL->pilotId(); 1035 int pid = inL->pilotId();
1036 local->deleteIncidence( inL ); 1036 local->deleteIncidence( inL );
1037 inL = inR->clone(); 1037 inL = inR->clone();
1038 if ( mSyncManager->syncWithDesktop() ) 1038 if ( mSyncManager->syncWithDesktop() )
1039 inL->setPilotId( pid ); 1039 inL->setPilotId( pid );
@@ -1043,13 +1043,13 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1043 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); 1043 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) );
1044 } 1044 }
1045 local->addIncidence( inL ); 1045 local->addIncidence( inL );
1046 ++changedLocal; 1046 ++changedLocal;
1047 } 1047 }
1048 } 1048 }
1049 } else { // no conflict 1049 } else { // no conflict ********** add or delete remote
1050 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1050 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1051 QString des = eventLSync->description(); 1051 QString des = eventLSync->description();
1052 QString pref = "e"; 1052 QString pref = "e";
1053 if ( inR->type() == "Todo" ) 1053 if ( inR->type() == "Todo" )
1054 pref = "t"; 1054 pref = "t";
1055 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it 1055 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it
@@ -1057,12 +1057,14 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1057 //remote->deleteIncidence( inR ); 1057 //remote->deleteIncidence( inR );
1058 ++deletedEventR; 1058 ++deletedEventR;
1059 } else { 1059 } else {
1060 inR->setLastModified( modifiedCalendar ); 1060 inR->setLastModified( modifiedCalendar );
1061 inL = inR->clone(); 1061 inL = inR->clone();
1062 inL->setIDStr( ":" ); 1062 inL->setIDStr( ":" );
1063 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1064 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) );
1063 local->addIncidence( inL ); 1065 local->addIncidence( inL );
1064 ++addedEvent; 1066 ++addedEvent;
1065 } 1067 }
1066 } else { 1068 } else {
1067 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) { 1069 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) {
1068 inR->setLastModified( modifiedCalendar ); 1070 inR->setLastModified( modifiedCalendar );
@@ -1101,13 +1103,13 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1101 if ( uid.left(15) == QString("last-syncEvent-") ) 1103 if ( uid.left(15) == QString("last-syncEvent-") )
1102 skipIncidence = true; 1104 skipIncidence = true;
1103 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" ) 1105 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" )
1104 skipIncidence = true; 1106 skipIncidence = true;
1105 if ( !skipIncidence ) { 1107 if ( !skipIncidence ) {
1106 inR = remote->incidence( uid ); 1108 inR = remote->incidence( uid );
1107 if ( ! inR ) { 1109 if ( ! inR ) { // no conflict ********** add or delete local
1108 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1110 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1109 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { 1111 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
1110 checkExternSyncEvent(eventLSyncSharp, inL); 1112 checkExternSyncEvent(eventLSyncSharp, inL);
1111 local->deleteIncidence( inL ); 1113 local->deleteIncidence( inL );
1112 ++deletedEventL; 1114 ++deletedEventL;
1113 } else { 1115 } else {