summaryrefslogtreecommitdiffabout
path: root/libkcal
Unidiff
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calendar.h1
-rw-r--r--libkcal/calendarlocal.cpp25
-rw-r--r--libkcal/calendarlocal.h1
3 files changed, 26 insertions, 1 deletions
diff --git a/libkcal/calendar.h b/libkcal/calendar.h
index 0a94914..66836a1 100644
--- a/libkcal/calendar.h
+++ b/libkcal/calendar.h
@@ -318,2 +318,3 @@ public:
318 virtual void setCalendarEnabled( int id, bool enable ) = 0; 318 virtual void setCalendarEnabled( int id, bool enable ) = 0;
319 virtual void setAllCalendarEnabled( bool enable ) = 0;
319 virtual void setAlarmEnabled( int id, bool enable ) = 0; 320 virtual void setAlarmEnabled( int id, bool enable ) = 0;
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()
192 ev->setReadOnly( true ); 192 ev->setReadOnly( true );
193 ev->setCalID( 1 );
194 } 193 }
@@ -197,2 +196,3 @@ void CalendarLocal::setSyncEventsReadOnly()
197} 196}
197
198void CalendarLocal::addCalendar( Calendar* cal ) 198void CalendarLocal::addCalendar( Calendar* cal )
@@ -200,6 +200,13 @@ void CalendarLocal::addCalendar( Calendar* cal )
200 cal->setDontDeleteIncidencesOnClose(); 200 cal->setDontDeleteIncidencesOnClose();
201 setSyncEventsEnabled();
201 { 202 {
202 QPtrList<Event> EventList = cal->rawEvents(); 203 QPtrList<Event> EventList = cal->rawEvents();
204 QPtrList<Event> el;
203 Event * ev = EventList.first(); 205 Event * ev = EventList.first();
204 while ( ev ) { 206 while ( ev ) {
207 if ( ev->uid().left( 15 ) == QString("last-syncEvent-") ) {
208 Event * se = event( ev->uid() );
209 if ( se )
210 el.append( se );
211 }
205 ev->unRegisterObserver( cal ); 212 ev->unRegisterObserver( cal );
@@ -209,2 +216,5 @@ void CalendarLocal::addCalendar( Calendar* cal )
209 } 216 }
217 for ( ev = el.first(); ev; ev = el.next() ) {
218 deleteIncidence ( ev );
219 }
210 } 220 }
@@ -1005,2 +1015,15 @@ void CalendarLocal::setCalendarRemove( int id )
1005 1015
1016void CalendarLocal::setAllCalendarEnabled( bool enable )
1017{
1018 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
1019 it->setCalEnabled( enable );
1020
1021 for ( Event *it = mEventList.first(); it; it = mEventList.next() )
1022 it->setCalEnabled( enable );
1023
1024 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() )
1025 it->setCalEnabled( enable );
1026
1027
1028}
1006void CalendarLocal::setCalendarEnabled( int id, bool enable ) 1029void CalendarLocal::setCalendarEnabled( int id, bool enable )
diff --git a/libkcal/calendarlocal.h b/libkcal/calendarlocal.h
index eb7bf34..b70f0c9 100644
--- a/libkcal/calendarlocal.h
+++ b/libkcal/calendarlocal.h
@@ -196,2 +196,3 @@ public slots:
196 void setCalendarRemove( int id ); 196 void setCalendarRemove( int id );
197 void setAllCalendarEnabled( bool enable );
197 198