author | zautrix <zautrix> | 2004-10-17 19:15:12 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-17 19:15:12 (UTC) |
commit | a20e8333d7178a01672545232b74bd5cb6d6958b (patch) (unidiff) | |
tree | c21854e85a9d5da5e91abba6705de8b3929ad97f | |
parent | 6f6d1d58938539215bb4fcb5b97cf9fb089a11ef (diff) | |
download | kdepimpi-a20e8333d7178a01672545232b74bd5cb6d6958b.zip kdepimpi-a20e8333d7178a01672545232b74bd5cb6d6958b.tar.gz kdepimpi-a20e8333d7178a01672545232b74bd5cb6d6958b.tar.bz2 |
kde sync fixes
-rw-r--r-- | korganizer/calendarview.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index ff1db2c..290c0b9 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -714,12 +714,6 @@ void CalendarView::createPrinter() | |||
714 | int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , bool full ) | 714 | int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , bool full ) |
715 | { | 715 | { |
716 | 716 | ||
717 | //void setZaurusId(int id); | ||
718 | // int zaurusId() const; | ||
719 | // void setZaurusUid(int id); | ||
720 | // int zaurusUid() const; | ||
721 | // void setZaurusStat(int id); | ||
722 | // int zaurusStat() const; | ||
723 | // 0 equal | 717 | // 0 equal |
724 | // 1 take local | 718 | // 1 take local |
725 | // 2 take remote | 719 | // 2 take remote |
@@ -943,7 +937,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
943 | remote->deleteEvent(eventR ); | 937 | remote->deleteEvent(eventR ); |
944 | 938 | ||
945 | } else { | 939 | } else { |
946 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 940 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncKDE) { |
947 | eventRSync = (Event*)eventLSync->clone(); | 941 | eventRSync = (Event*)eventLSync->clone(); |
948 | } else { | 942 | } else { |
949 | fullDateRange = true; | 943 | fullDateRange = true; |
@@ -973,10 +967,10 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
973 | // for resyncing if own file has changed | 967 | // for resyncing if own file has changed |
974 | if ( mCurrentSyncDevice == "deleteaftersync" ) { | 968 | if ( mCurrentSyncDevice == "deleteaftersync" ) { |
975 | mLastCalendarSync = loadedFileVersion; | 969 | mLastCalendarSync = loadedFileVersion; |
976 | qDebug("setting mLastCalendarSync "); | 970 | //qDebug("setting mLastCalendarSync "); |
977 | } | 971 | } |
978 | //qDebug("*************************** "); | 972 | //qDebug("*************************** "); |
979 | qDebug("mLastCalendarSync %s ",mLastCalendarSync.toString().latin1() ); | 973 | qDebug("mLastCalendarSync %s full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); |
980 | QPtrList<Incidence> er = remote->rawIncidences(); | 974 | QPtrList<Incidence> er = remote->rawIncidences(); |
981 | Incidence* inR = er.first(); | 975 | Incidence* inR = er.first(); |
982 | Incidence* inL; | 976 | Incidence* inL; |
@@ -1008,9 +1002,6 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1008 | if ( !skipIncidence ) { | 1002 | if ( !skipIncidence ) { |
1009 | inL = local->incidence( uid ); | 1003 | inL = local->incidence( uid ); |
1010 | if ( inL ) { // maybe conflict - same uid in both calendars | 1004 | if ( inL ) { // maybe conflict - same uid in both calendars |
1011 | int maxrev = inL->revision(); | ||
1012 | if ( maxrev < inR->revision() ) | ||
1013 | maxrev = inR->revision(); | ||
1014 | if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { | 1005 | if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { |
1015 | //qDebug("take %d %s ", take, inL->summary().latin1()); | 1006 | //qDebug("take %d %s ", take, inL->summary().latin1()); |
1016 | if ( take == 3 ) | 1007 | if ( take == 3 ) |
@@ -1021,8 +1012,6 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1021 | else | 1012 | else |
1022 | idS = inR->IDStr(); | 1013 | idS = inR->IDStr(); |
1023 | remote->deleteIncidence( inR ); | 1014 | remote->deleteIncidence( inR ); |
1024 | if ( inL->revision() < maxrev ) | ||
1025 | inL->setRevision( maxrev ); | ||
1026 | inR = inL->clone(); | 1015 | inR = inL->clone(); |
1027 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); | 1016 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); |
1028 | if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) | 1017 | if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) |
@@ -1032,8 +1021,6 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1032 | inR->setPilotId( 2 ); | 1021 | inR->setPilotId( 2 ); |
1033 | ++changedRemote; | 1022 | ++changedRemote; |
1034 | } else { | 1023 | } else { |
1035 | if ( inR->revision() < maxrev ) | ||
1036 | inR->setRevision( maxrev ); | ||
1037 | idS = inL->IDStr(); | 1024 | idS = inL->IDStr(); |
1038 | int pid = inL->pilotId(); | 1025 | int pid = inL->pilotId(); |
1039 | local->deleteIncidence( inL ); | 1026 | local->deleteIncidence( inL ); |