summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Unidiff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index fd68dc4..b543eca 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -980,49 +980,49 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
980 if ( take == 3 ) 980 if ( take == 3 )
981 return false; 981 return false;
982 if ( take == 1 ) {// take local 982 if ( take == 1 ) {// take local
983 inL->setZaurusUid( inR->zaurusUid() ); 983 inL->setZaurusUid( inR->zaurusUid() );
984 remote->deleteIncidence( inR ); 984 remote->deleteIncidence( inR );
985 if ( inL->revision() < maxrev ) 985 if ( inL->revision() < maxrev )
986 inL->setRevision( maxrev ); 986 inL->setRevision( maxrev );
987 remote->addIncidence( inL->clone() ); 987 remote->addIncidence( inL->clone() );
988 ++changedRemote; 988 ++changedRemote;
989 } else { 989 } else {
990 if ( inR->revision() < maxrev ) 990 if ( inR->revision() < maxrev )
991 inR->setRevision( maxrev ); 991 inR->setRevision( maxrev );
992 local->deleteIncidence( inL ); 992 local->deleteIncidence( inL );
993 local->addIncidence( inR->clone() ); 993 local->addIncidence( inR->clone() );
994 ++changedLocal; 994 ++changedLocal;
995 } 995 }
996 } 996 }
997 } else { // no conflict 997 } else { // no conflict
998 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 998 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
999 QString des = eventLSync->description(); 999 QString des = eventLSync->description();
1000 QString pref = "e"; 1000 QString pref = "e";
1001 if ( inR->type() == "Todo" ) 1001 if ( inR->type() == "Todo" )
1002 pref = "t"; 1002 pref = "t";
1003 if ( des.find(pref+QString::number( inR->zaurusId() ) +"," ) >= 0 && mode != 5) { // delete it 1003 if ( des.find(pref+QString::number( inR->zaurusId() ) +"," ) >= 0 && mode != 5) { // delete it
1004 inR->setZaurusStat( SYNC_TEMPSTATE_DELETE ); 1004 inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE );
1005 //remote->deleteIncidence( inR ); 1005 //remote->deleteIncidence( inR );
1006 ++deletedEventR; 1006 ++deletedEventR;
1007 } else { 1007 } else {
1008 inR->setLastModified( modifiedCalendar ); 1008 inR->setLastModified( modifiedCalendar );
1009 local->addIncidence( inR->clone() ); 1009 local->addIncidence( inR->clone() );
1010 ++addedEvent; 1010 ++addedEvent;
1011 } 1011 }
1012 } else { 1012 } else {
1013 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) { 1013 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) {
1014 inR->setLastModified( modifiedCalendar ); 1014 inR->setLastModified( modifiedCalendar );
1015 local->addIncidence( inR->clone() ); 1015 local->addIncidence( inR->clone() );
1016 ++addedEvent; 1016 ++addedEvent;
1017 } else { 1017 } else {
1018 checkSharpEvent(eventRSyncSharp, inR); 1018 checkSharpEvent(eventRSyncSharp, inR);
1019 remote->deleteIncidence( inR ); 1019 remote->deleteIncidence( inR );
1020 ++deletedEventR; 1020 ++deletedEventR;
1021 } 1021 }
1022 } 1022 }
1023 } 1023 }
1024 } 1024 }
1025 inR = er.next(); 1025 inR = er.next();
1026 } 1026 }
1027 QPtrList<Incidence> el = local->rawIncidences(); 1027 QPtrList<Incidence> el = local->rawIncidences();
1028 inL = el.first(); 1028 inL = el.first();
@@ -1150,49 +1150,49 @@ void CalendarView::syncSharp()
1150 bool syncOK = false; 1150 bool syncOK = false;
1151 SharpFormat sharpFormat; 1151 SharpFormat sharpFormat;
1152 if ( sharpFormat.load( calendar, mCalendar ) ) { 1152 if ( sharpFormat.load( calendar, mCalendar ) ) {
1153 getEventViewerDialog()->setSyncMode( true ); 1153 getEventViewerDialog()->setSyncMode( true );
1154 syncOK = synchronizeCalendar( mCalendar, calendar, KOPrefs::instance()->mSyncAlgoPrefs ); 1154 syncOK = synchronizeCalendar( mCalendar, calendar, KOPrefs::instance()->mSyncAlgoPrefs );
1155 getEventViewerDialog()->setSyncMode( false ); 1155 getEventViewerDialog()->setSyncMode( false );
1156 qApp->processEvents(); 1156 qApp->processEvents();
1157 if ( syncOK ) { 1157 if ( syncOK ) {
1158 if ( KOPrefs::instance()->mWriteBackFile ) 1158 if ( KOPrefs::instance()->mWriteBackFile )
1159 { 1159 {
1160 QPtrList<Incidence> iL = mCalendar->rawIncidences(); 1160 QPtrList<Incidence> iL = mCalendar->rawIncidences();
1161 Incidence* inc = iL.first(); 1161 Incidence* inc = iL.first();
1162 /* obsolete 1162 /* obsolete
1163 while ( inc ) { 1163 while ( inc ) {
1164 inc->setZaurusStat( inc->revision () ); 1164 inc->setZaurusStat( inc->revision () );
1165 inc = iL.next(); 1165 inc = iL.next();
1166 } 1166 }
1167 */ 1167 */
1168 // pending: clean last sync event description 1168 // pending: clean last sync event description
1169 sharpFormat.save(calendar); 1169 sharpFormat.save(calendar);
1170 iL = calendar->rawIncidences(); 1170 iL = calendar->rawIncidences();
1171 inc = iL.first(); 1171 inc = iL.first();
1172 Incidence* loc; 1172 Incidence* loc;
1173 while ( inc ) { 1173 while ( inc ) {
1174 if ( inc->zaurusStat() == SYNC_TEMPSTATE_NEW_ID ) { 1174 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) {
1175 loc = mCalendar->incidence(inc->uid() ); 1175 loc = mCalendar->incidence(inc->uid() );
1176 if ( loc ) { 1176 if ( loc ) {
1177 loc->setZaurusId( inc->zaurusId() ); 1177 loc->setZaurusId( inc->zaurusId() );
1178 loc->setZaurusUid( inc->zaurusUid() ); 1178 loc->setZaurusUid( inc->zaurusUid() );
1179 } 1179 }
1180 } 1180 }
1181 inc = iL.next(); 1181 inc = iL.next();
1182 } 1182 }
1183 Incidence* lse = getLastSyncEvent(); 1183 Incidence* lse = getLastSyncEvent();
1184 if ( lse ) { 1184 if ( lse ) {
1185 lse->setReadOnly( false ); 1185 lse->setReadOnly( false );
1186 lse->setDescription( "" ); 1186 lse->setDescription( "" );
1187 lse->setReadOnly( true ); 1187 lse->setReadOnly( true );
1188 } 1188 }
1189 } 1189 }
1190 } 1190 }
1191 setModified( true ); 1191 setModified( true );
1192 } else { 1192 } else {
1193 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; 1193 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ;
1194 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), 1194 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"),
1195 question, i18n("Ok")) ; 1195 question, i18n("Ok")) ;
1196 1196
1197 } 1197 }
1198 delete calendar; 1198 delete calendar;