-rw-r--r-- | korganizer/calendarview.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 8d024c1..1800cf2 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1604,6 +1604,7 @@ void CalendarView::checkExternalId( Incidence * inc ) | |||
1604 | checkExternSyncEvent( lastSync, inc ); | 1604 | checkExternSyncEvent( lastSync, inc ); |
1605 | 1605 | ||
1606 | } | 1606 | } |
1607 | // SSSSSSSSSSSSSSSSSSSSSS | ||
1607 | bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode ) | 1608 | bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode ) |
1608 | { | 1609 | { |
1609 | 1610 | ||
@@ -1723,8 +1724,15 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1723 | QString idS; | 1724 | QString idS; |
1724 | qApp->processEvents(); | 1725 | qApp->processEvents(); |
1725 | if ( !skipIncidence ) { | 1726 | if ( !skipIncidence ) { |
1726 | inL = local->incidenceForUid( uid , false , true ); | 1727 | int hasCalId = 0; |
1728 | inL = local->incidenceForUid( uid , false , true, &hasCalId ); | ||
1729 | if ( hasCalId && !inL ) | ||
1730 | inL = local->incidenceForUid( uid , false , true, &hasCalId ); | ||
1731 | else | ||
1732 | hasCalId = 0; | ||
1727 | if ( inL ) { // maybe conflict - same uid in both calendars | 1733 | if ( inL ) { // maybe conflict - same uid in both calendars |
1734 | if ( hasCalId ) | ||
1735 | qDebug("KO: Cal id %d conflict detected: %s ", hasCalId, inL->summary().latin1()); | ||
1728 | if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { | 1736 | if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { |
1729 | //qDebug("take %d %s ", take, inL->summary().latin1()); | 1737 | //qDebug("take %d %s ", take, inL->summary().latin1()); |
1730 | if ( take == 3 ) | 1738 | if ( take == 3 ) |
@@ -1750,6 +1758,8 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1750 | idS = inL->IDStr(); | 1758 | idS = inL->IDStr(); |
1751 | int pid = inL->pilotId(); | 1759 | int pid = inL->pilotId(); |
1752 | int calID = inL->calID(); | 1760 | int calID = inL->calID(); |
1761 | if ( hasCalId ) | ||
1762 | calID = hasCalId; | ||
1753 | local->deleteIncidence( inL ); | 1763 | local->deleteIncidence( inL ); |
1754 | inL = inR->clone(); | 1764 | inL = inR->clone(); |
1755 | inL->setCalID_block( calID ); | 1765 | inL->setCalID_block( calID ); |
@@ -1764,6 +1774,11 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1764 | ++changedLocal; | 1774 | ++changedLocal; |
1765 | } | 1775 | } |
1766 | } | 1776 | } |
1777 | } else { | ||
1778 | // take == 0; events equal | ||
1779 | if ( hasCalId ) | ||
1780 | qDebug("EV EQUALLLL **************************** "); | ||
1781 | |||
1767 | } | 1782 | } |
1768 | } else { // no conflict ********** add or delete remote | 1783 | } else { // no conflict ********** add or delete remote |
1769 | if ( !filterIN || filterIN->filterCalendarItem( inR ) ){ | 1784 | if ( !filterIN || filterIN->filterCalendarItem( inR ) ){ |