summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp44
1 files changed, 23 insertions, 21 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 1800cf2..8385bcc 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1733,4 +1733,3 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
if ( inL ) { // maybe conflict - same uid in both calendars
- if ( hasCalId )
- qDebug("KO: Cal id %d conflict detected: %s ", hasCalId, inL->summary().latin1());
+
if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) {
@@ -1746,11 +1745,14 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
remote->deleteIncidence( inR );
- inR = inL->clone();
- inR->setCalID_block( calID );
- inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
- if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL )
- inR->setIDStr( idS );
- remote->addIncidence( inR );
- if ( mSyncManager->syncWithDesktop() )
- inR->setPilotId( 2 );
- ++changedRemote;
+ if ( !hasCalId ) {
+ inR = inL->clone();
+ inR->setCalID_block( calID );
+ inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
+ if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL )
+ inR->setIDStr( idS );
+ remote->addIncidence( inR );
+ if ( mSyncManager->syncWithDesktop() )
+ inR->setPilotId( 2 );
+ ++changedRemote;
+ } else
+ ++deletedEventR;
} else {// take remote **********************
@@ -1760,4 +1762,4 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
int calID = inL->calID();
- if ( hasCalId )
- calID = hasCalId;
+ if ( hasCalId )
+ calID = 0;// add to default calendar
local->deleteIncidence( inL );
@@ -1778,6 +1780,10 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
// take == 0; events equal
- if ( hasCalId )
- qDebug("EV EQUALLLL **************************** ");
+ if ( hasCalId ) {
+ qDebug("KO: Changing Cal id %d to %d for : %s ", hasCalId, local->defaultCalendar(),inL->summary().latin1());
+ inL->setCalID( local->defaultCalendar() );
+ }
}
+
+
} else { // no conflict ********** add or delete remote
@@ -2484,4 +2490,4 @@ void CalendarView::mergeFileResource( QString fn ,QString resource )
mCalendar->setCalendarRemove( exclusiveResource );
- int def = mCalendar->defaultCalendar();
mCalendar->setDefaultCalendar(exclusiveResource);
+ mCalendar->setAllCalendarEnabled( true );
if ( !mCalendar->addCalendarFile( fn, exclusiveResource )) {
@@ -2489,7 +2495,3 @@ void CalendarView::mergeFileResource( QString fn ,QString resource )
}
- mCalendar->setDefaultCalendar( def );
- mCalendar->reInitAlarmSettings();
- setSyncEventsReadOnly();
- updateUnmanagedViews();
- updateView();
+ restoreCalendarSettings();
}