author | zautrix <zautrix> | 2005-11-26 11:20:22 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-11-26 11:20:22 (UTC) |
commit | 85bd9f05564e566b296c949ce6e214ebdbf573ac (patch) (unidiff) | |
tree | b00eb9453ea06f2b43fd896a9a4840b7d64af69b | |
parent | 3cd0013c04172b312ee21e80224a3b7734b4d413 (diff) | |
download | kdepimpi-85bd9f05564e566b296c949ce6e214ebdbf573ac.zip kdepimpi-85bd9f05564e566b296c949ce6e214ebdbf573ac.tar.gz kdepimpi-85bd9f05564e566b296c949ce6e214ebdbf573ac.tar.bz2 |
sync
-rw-r--r-- | korganizer/calendarview.cpp | 4 | ||||
-rw-r--r-- | libkcal/calendar.h | 2 | ||||
-rw-r--r-- | libkcal/calendarlocal.cpp | 11 | ||||
-rw-r--r-- | libkcal/calendarlocal.h | 2 |
4 files changed, 14 insertions, 5 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 538325e..9571f16 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1717,9 +1717,9 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1717 | skipIncidence = true; | 1717 | skipIncidence = true; |
1718 | QString idS; | 1718 | QString idS; |
1719 | qApp->processEvents(); | 1719 | qApp->processEvents(); |
1720 | if ( !skipIncidence ) { | 1720 | if ( !skipIncidence ) { |
1721 | inL = local->incidenceForUid( uid , false ); | 1721 | inL = local->incidenceForUid( uid , false , true ); |
1722 | if ( inL ) { // maybe conflict - same uid in both calendars | 1722 | if ( inL ) { // maybe conflict - same uid in both calendars |
1723 | if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { | 1723 | if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { |
1724 | //qDebug("take %d %s ", take, inL->summary().latin1()); | 1724 | //qDebug("take %d %s ", take, inL->summary().latin1()); |
1725 | if ( take == 3 ) | 1725 | if ( take == 3 ) |
@@ -1827,9 +1827,9 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1827 | skipIncidence = true; | 1827 | skipIncidence = true; |
1828 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID ) | 1828 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID ) |
1829 | skipIncidence = true; | 1829 | skipIncidence = true; |
1830 | if ( !skipIncidence ) { | 1830 | if ( !skipIncidence ) { |
1831 | inR = remote->incidenceForUid( uid , true ); | 1831 | inR = remote->incidenceForUid( uid , true, true ); |
1832 | if ( ! inR ) { | 1832 | if ( ! inR ) { |
1833 | if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ | 1833 | if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ |
1834 | // no conflict ********** add or delete local | 1834 | // no conflict ********** add or delete local |
1835 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 1835 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
diff --git a/libkcal/calendar.h b/libkcal/calendar.h index 66836a1..f301768 100644 --- a/libkcal/calendar.h +++ b/libkcal/calendar.h | |||
@@ -76,9 +76,9 @@ public: | |||
76 | virtual void close() = 0; | 76 | virtual void close() = 0; |
77 | virtual void addCalendar( Calendar* ) = 0; | 77 | virtual void addCalendar( Calendar* ) = 0; |
78 | virtual bool addCalendarFile( QString name, int id ) = 0; | 78 | virtual bool addCalendarFile( QString name, int id ) = 0; |
79 | virtual bool mergeCalendarFile( QString name ) = 0; | 79 | virtual bool mergeCalendarFile( QString name ) = 0; |
80 | virtual Incidence* incidenceForUid( const QString& uid, bool doNotCheckDuplicates ) = 0; | 80 | virtual Incidence* incidenceForUid( const QString& uid, bool doNotCheckDuplicates , bool enabledOnly = false ) = 0; |
81 | virtual void setSyncEventsReadOnly() = 0; | 81 | virtual void setSyncEventsReadOnly() = 0; |
82 | virtual void setSyncEventsEnabled() = 0; | 82 | virtual void setSyncEventsEnabled() = 0; |
83 | virtual void stopAllTodos() = 0; | 83 | virtual void stopAllTodos() = 0; |
84 | virtual void clearUndo( Incidence * newUndo ); | 84 | virtual void clearUndo( Incidence * newUndo ); |
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index b02f706..ad8ace3 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp | |||
@@ -79,14 +79,17 @@ bool CalendarLocal::mergeCalendarFile( QString name ) | |||
79 | } | 79 | } |
80 | return false; | 80 | return false; |
81 | } | 81 | } |
82 | 82 | ||
83 | Incidence* CalendarLocal::incidenceForUid( const QString& uid , bool doNotCheckDuplicates) | 83 | Incidence* CalendarLocal::incidenceForUid( const QString& uid , bool doNotCheckDuplicates, bool enabledOnly ) |
84 | { | 84 | { |
85 | Todo *todo;; | 85 | Todo *todo;; |
86 | Incidence *retVal = 0; | 86 | Incidence *retVal = 0; |
87 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { | 87 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { |
88 | if ( todo->uid() == uid ) { | 88 | if ( todo->uid() == uid ) { |
89 | if ( enabledOnly ) | ||
90 | if ( !todo->calEnabled() ) | ||
91 | continue; | ||
89 | if ( doNotCheckDuplicates ) return todo; | 92 | if ( doNotCheckDuplicates ) return todo; |
90 | if ( retVal ) { | 93 | if ( retVal ) { |
91 | if ( retVal->calID() > todo->calID() ) { | 94 | if ( retVal->calID() > todo->calID() ) { |
92 | retVal = todo; | 95 | retVal = todo; |
@@ -99,8 +102,11 @@ Incidence* CalendarLocal::incidenceForUid( const QString& uid , bool doNotCheckD | |||
99 | if ( retVal ) return retVal; | 102 | if ( retVal ) return retVal; |
100 | Event *event; | 103 | Event *event; |
101 | for ( event = mEventList.first(); event; event = mEventList.next() ) { | 104 | for ( event = mEventList.first(); event; event = mEventList.next() ) { |
102 | if ( event->uid() == uid ) { | 105 | if ( event->uid() == uid ) { |
106 | if ( enabledOnly ) | ||
107 | if ( !event->calEnabled() ) | ||
108 | continue; | ||
103 | if ( doNotCheckDuplicates ) return event; | 109 | if ( doNotCheckDuplicates ) return event; |
104 | if ( retVal ) { | 110 | if ( retVal ) { |
105 | if ( retVal->calID() > event->calID() ) { | 111 | if ( retVal->calID() > event->calID() ) { |
106 | retVal = event; | 112 | retVal = event; |
@@ -112,8 +118,11 @@ Incidence* CalendarLocal::incidenceForUid( const QString& uid , bool doNotCheckD | |||
112 | } | 118 | } |
113 | if ( retVal ) return retVal; | 119 | if ( retVal ) return retVal; |
114 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) | 120 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) |
115 | if ( it->uid() == uid ) { | 121 | if ( it->uid() == uid ) { |
122 | if ( enabledOnly ) | ||
123 | if ( !it->calEnabled() ) | ||
124 | continue; | ||
116 | if ( doNotCheckDuplicates ) return it; | 125 | if ( doNotCheckDuplicates ) return it; |
117 | if ( retVal ) { | 126 | if ( retVal ) { |
118 | if ( retVal->calID() > it->calID() ) { | 127 | if ( retVal->calID() > it->calID() ) { |
119 | retVal = it; | 128 | retVal = it; |
diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h index b70f0c9..b611704 100644 --- a/libkcal/calendarlocal.h +++ b/libkcal/calendarlocal.h | |||
@@ -46,9 +46,9 @@ class CalendarLocal : public Calendar | |||
46 | void addCalendar( Calendar* ); | 46 | void addCalendar( Calendar* ); |
47 | bool addCalendarFile( QString name, int id ); | 47 | bool addCalendarFile( QString name, int id ); |
48 | bool mergeCalendarFile( QString name ); | 48 | bool mergeCalendarFile( QString name ); |
49 | bool mergeCalendar( Calendar* cal ); | 49 | bool mergeCalendar( Calendar* cal ); |
50 | Incidence* incidenceForUid( const QString& uid, bool doNotCheckDuplicates ); | 50 | Incidence* incidenceForUid( const QString& uid, bool doNotCheckDuplicates, bool enabledOnly = false ); |
51 | void setSyncEventsReadOnly(); | 51 | void setSyncEventsReadOnly(); |
52 | void setSyncEventsEnabled(); | 52 | void setSyncEventsEnabled(); |
53 | void stopAllTodos(); | 53 | void stopAllTodos(); |
54 | /** | 54 | /** |