-rw-r--r-- | libkcal/calendarlocal.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index 21b4aaf..3f46d53 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp | |||
@@ -216,17 +216,38 @@ Todo *CalendarLocal::todo( QString syncProf, QString id ) | |||
216 | { | 216 | { |
217 | Todo *todo; | 217 | Todo *todo; |
218 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { | 218 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { |
219 | if ( todo->getID( syncProf ) == id ) return todo; | 219 | if ( todo->getID( syncProf ) == id ) return todo; |
220 | } | 220 | } |
221 | 221 | ||
222 | return 0; | 222 | return 0; |
223 | } | 223 | } |
224 | 224 | void CalendarLocal::removeSyncInfo( QString syncProfile) | |
225 | { | ||
226 | QPtrList<Incidence> all = rawIncidences() ; | ||
227 | Incidence *inc; | ||
228 | for ( inc = all.first(); inc; inc = all.next() ) { | ||
229 | inc->removeID( syncProfile ); | ||
230 | } | ||
231 | if ( syncProfile.isEmpty() ) { | ||
232 | QPtrList<Event> el; | ||
233 | Event *todo; | ||
234 | for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { | ||
235 | if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) | ||
236 | el.append( todo ); | ||
237 | } | ||
238 | for ( todo = el.first(); todo; todo = el.next() ) { | ||
239 | deleteIncidence ( todo ); | ||
240 | } | ||
241 | } else { | ||
242 | Event *lse = event( "last-syncEvent-"+ syncProfile); | ||
243 | deleteIncidence ( lse ); | ||
244 | } | ||
245 | } | ||
225 | QPtrList<Event> CalendarLocal::getExternLastSyncEvents() | 246 | QPtrList<Event> CalendarLocal::getExternLastSyncEvents() |
226 | { | 247 | { |
227 | QPtrList<Event> el; | 248 | QPtrList<Event> el; |
228 | Event *todo; | 249 | Event *todo; |
229 | for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { | 250 | for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { |
230 | if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) | 251 | if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) |
231 | if ( todo->summary().left(3) == "E: " ) | 252 | if ( todo->summary().left(3) == "E: " ) |
232 | el.append( todo ); | 253 | el.append( todo ); |