author | zautrix <zautrix> | 2004-10-26 22:19:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-26 22:19:18 (UTC) |
commit | 6385f303bef3cbcd19d097a7b05c30e144d5dd6e (patch) (side-by-side diff) | |
tree | 770795d94ea6ec1dc8bcaa67cc174a9c0add564a /libkcal/calendarlocal.cpp | |
parent | 13e996beddabc5e88f4f2fe49b2ce6cb8408eb30 (diff) | |
download | kdepimpi-6385f303bef3cbcd19d097a7b05c30e144d5dd6e.zip kdepimpi-6385f303bef3cbcd19d097a7b05c30e144d5dd6e.tar.gz kdepimpi-6385f303bef3cbcd19d097a7b05c30e144d5dd6e.tar.bz2 |
implemented remove sync info for kopi and kapi
-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 @@ -220,9 +220,30 @@ Todo *CalendarLocal::todo( QString syncProf, QString id ) } return 0; } - +void CalendarLocal::removeSyncInfo( QString syncProfile) +{ + QPtrList<Incidence> all = rawIncidences() ; + Incidence *inc; + for ( inc = all.first(); inc; inc = all.next() ) { + inc->removeID( syncProfile ); + } + if ( syncProfile.isEmpty() ) { + QPtrList<Event> el; + Event *todo; + for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { + if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) + el.append( todo ); + } + for ( todo = el.first(); todo; todo = el.next() ) { + deleteIncidence ( todo ); + } + } else { + Event *lse = event( "last-syncEvent-"+ syncProfile); + deleteIncidence ( lse ); + } +} QPtrList<Event> CalendarLocal::getExternLastSyncEvents() { QPtrList<Event> el; Event *todo; |