summaryrefslogtreecommitdiffabout
path: root/libkcal/calendarlocal.cpp
Side-by-side diff
Diffstat (limited to 'libkcal/calendarlocal.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calendarlocal.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 8a5a76f..ce3cd09 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -282,16 +282,16 @@ void CalendarLocal::addCalendar( Calendar* cal )
QPtrList<Todo> TodoList = cal->rawTodos();
Todo * ev = TodoList.first();
while ( ev ) {
ev->resetRelatedTo();
- ev = TodoList.next();
+ Todo * se = todo( ev->uid() );
+ if ( se )
+ deleteTodo( se );
+ ev = TodoList.next();
}
- //TodoList = cal->rawTodos();
+ //TodoList = cal->rawTodos();
ev = TodoList.first();
while ( ev ) {
- Todo * se = todo( ev->uid() );
- if ( se )
- incList.append( se );
ev->unRegisterObserver( cal );
ev->registerObserver( this );
mTodoList.append( ev );
setupRelations( ev );
@@ -311,10 +311,10 @@ void CalendarLocal::addCalendar( Calendar* cal )
ev = JournalList.next();
}
}
{
- for (Incidence * ev = incList.first(); ev; ev = incList.next() ) {
- deleteIncidence ( ev );
+ for (Incidence * inc = incList.first(); inc; inc = incList.next() ) {
+ deleteIncidence ( inc );
}
}
setModified( true );
}