summaryrefslogtreecommitdiffabout
path: root/libkcal
Side-by-side diff
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calendarlocal.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 980663f..8a5a76f 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -261,13 +261,13 @@ void CalendarLocal::addCalendar( Calendar* cal )
setSyncEventsEnabled();
+ QPtrList<Incidence> incList;
{
QPtrList<Event> EventList = cal->rawEvents();
- QPtrList<Event> el;
Event * ev = EventList.first();
while ( ev ) {
- if ( ev->uid().left( 15 ) == QString("last-syncEvent-") ) {
- Event * se = event( ev->uid() );
- if ( se )
- el.append( se );
+ if ( ev->uid().left( 15 ) == QString("last-syncEvent-") ) {
ev->setCalID_block( 1 );
}
+ Event * se = event( ev->uid() );
+ if ( se )
+ incList.append( se );
ev->unRegisterObserver( cal );
@@ -277,5 +277,3 @@ void CalendarLocal::addCalendar( Calendar* cal )
}
- for ( ev = el.first(); ev; ev = el.next() ) {
- deleteIncidence ( ev );
- }
+
}
@@ -291,3 +289,6 @@ void CalendarLocal::addCalendar( Calendar* cal )
ev = TodoList.first();
- while ( ev ) {
+ while ( ev ) {
+ Todo * se = todo( ev->uid() );
+ if ( se )
+ incList.append( se );
ev->unRegisterObserver( cal );
@@ -303,2 +304,5 @@ void CalendarLocal::addCalendar( Calendar* cal )
while ( ev ) {
+ Journal * se = journal( ev->uid() );
+ if ( se )
+ incList.append( se );
ev->unRegisterObserver( cal );
@@ -309,2 +313,7 @@ void CalendarLocal::addCalendar( Calendar* cal )
}
+ {
+ for (Incidence * ev = incList.first(); ev; ev = incList.next() ) {
+ deleteIncidence ( ev );
+ }
+ }
setModified( true );