summaryrefslogtreecommitdiffabout
path: root/libkcal/calendarlocal.cpp
Unidiff
Diffstat (limited to 'libkcal/calendarlocal.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/calendarlocal.cpp54
1 files changed, 53 insertions, 1 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index c5500bf..e48122a 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -67,5 +67,43 @@ CalendarLocal::~CalendarLocal()
67{ 67{
68 if ( mDeleteIncidencesOnClose )
68 close(); 69 close();
69} 70}
70 71bool CalendarLocal::addCalendarFile( QString name, int id )
72{
73 CalendarLocal calendar( timeZoneId() );
74 calendar.setDefaultCalendar( id );
75 if ( calendar.load( name ) ) {
76 addCalendar( &calendar );
77 return true;
78 }
79 return false;
80}
81void CalendarLocal::addCalendar( Calendar* cal )
82{
83 cal->setDontDeleteIncidencesOnClose();
84 {
85 QPtrList<Event> EventList = cal->rawEvents();
86 Event * ev = EventList.first();
87 while ( ev ) {
88 mEventList.append( ev );
89 ev = EventList.next();
90 }
91 }
92 {
93 QPtrList<Todo> TodoList = cal->rawTodos();
94 Todo * ev = TodoList.first();
95 while ( ev ) {
96 mTodoList.append( ev );
97 ev = TodoList.next();
98 }
99 }
100 {
101 QPtrList<Journal> JournalList = cal->journals();
102 Journal * ev = JournalList.first();
103 while ( ev ) {
104 mJournalList.append( ev );
105 ev = JournalList.next();
106 }
107 }
108}
71bool CalendarLocal::load( const QString &fileName ) 109bool CalendarLocal::load( const QString &fileName )
@@ -758,2 +796,16 @@ void CalendarLocal::setCalendarEnabled( int id, bool enable )
758} 796}
797
798void CalendarLocal::setReadOnly( int id, bool enable )
799{
800 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )
801 if ( it->calID() == id ) it->setReadOnly( enable );
802
803 for ( Event *it = mEventList.first(); it; it = mEventList.next() )
804 if ( it->calID() == id ) it->setReadOnly( enable );
805
806 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() )
807 if ( it->calID() == id ) it->setReadOnly( enable );
808
809}
810
759void CalendarLocal::setAlarmEnabled( int id, bool enable ) 811void CalendarLocal::setAlarmEnabled( int id, bool enable )