summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index f727cd4..ff1db2c 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -758,5 +758,5 @@ int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , b
} else {
if ( localMod == remoteMod )
- if ( local->revision() == remote->revision() )
+ // if ( local->revision() == remote->revision() )
return 0;
@@ -933,9 +933,6 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
bool fullDateRange = false;
local->resetTempSyncStat();
-#ifdef DESKTOP_VERSION
- //Needed for KDE - OL sync
- local->resetPilotStat();
- remote->resetPilotStat();
-#endif
+ if ( mSyncKDE )
+ remote->resetPilotStat(1);
mLastCalendarSync = QDateTime::currentDateTime();
QDateTime modifiedCalendar = mLastCalendarSync;;
@@ -970,5 +967,5 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
}
}
- if ( fullDateRange )
+ if ( fullDateRange && !mSyncKDE )
mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365);
else
@@ -1032,7 +1029,6 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
inR->setIDStr( idS );
remote->addIncidence( inR );
-#ifdef DESKTOP_VERSION
- inR->setPilotId( 1 );
-#endif
+ if ( mSyncKDE )
+ inR->setPilotId( 2 );
++changedRemote;
} else {
@@ -1040,6 +1036,9 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
inR->setRevision( maxrev );
idS = inL->IDStr();
+ int pid = inL->pilotId();
local->deleteIncidence( inL );
inL = inR->clone();
+ if ( mSyncKDE )
+ inL->setPilotId( pid );
inL->setIDStr( idS );
if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
@@ -1182,6 +1181,8 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName );
eventLSync->setReadOnly( true );
- if ( mGlobalSyncMode == SYNC_MODE_NORMAL)
+ if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncKDE) // kde is abnormal...
remote->addEvent( eventRSync );
+ else
+ delete eventRSync;
QString mes;
mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedEvent, addedEventR, changedLocal, changedRemote, deletedEventL, deletedEventR );
@@ -3735,4 +3736,9 @@ bool CalendarView::sync(KSyncManager* manager, QString filename, int mode)
{
// mSyncManager = manager;
+ mSyncKDE = false;
+ if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) {
+ qDebug("SyncKDE request detected!");
+ mSyncKDE = true;
+ }
mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
mCurrentSyncName = mSyncManager->getCurrentSyncName();
@@ -3741,4 +3747,5 @@ bool CalendarView::sync(KSyncManager* manager, QString filename, int mode)
bool CalendarView::syncExternal(KSyncManager* manager, QString resource)
{
+ mSyncKDE = false;
//mSyncManager = manager;
mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();