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.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 45e3128..2a57724 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -192,3 +192,2 @@ void CalendarLocal::setSyncEventsReadOnly()
ev->setReadOnly( true );
- ev->setCalID( 1 );
}
@@ -197,2 +196,3 @@ void CalendarLocal::setSyncEventsReadOnly()
}
+
void CalendarLocal::addCalendar( Calendar* cal )
@@ -200,6 +200,13 @@ void CalendarLocal::addCalendar( Calendar* cal )
cal->setDontDeleteIncidencesOnClose();
+ setSyncEventsEnabled();
{
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 );
+ }
ev->unRegisterObserver( cal );
@@ -209,2 +216,5 @@ void CalendarLocal::addCalendar( Calendar* cal )
}
+ for ( ev = el.first(); ev; ev = el.next() ) {
+ deleteIncidence ( ev );
+ }
}
@@ -1005,2 +1015,15 @@ void CalendarLocal::setCalendarRemove( int id )
+void CalendarLocal::setAllCalendarEnabled( bool enable )
+{
+ for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
+ it->setCalEnabled( enable );
+
+ for ( Event *it = mEventList.first(); it; it = mEventList.next() )
+ it->setCalEnabled( enable );
+
+ for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() )
+ it->setCalEnabled( enable );
+
+
+}
void CalendarLocal::setCalendarEnabled( int id, bool enable )