summaryrefslogtreecommitdiffabout
path: root/libkcal/calendarlocal.cpp
authorzautrix <zautrix>2005-06-13 10:51:47 (UTC)
committer zautrix <zautrix>2005-06-13 10:51:47 (UTC)
commit4f3ff02932b39bf16b9692c3cb69c101a28b4616 (patch) (unidiff)
treebae36a7e654c788a0994bb353f3997b495e2459c /libkcal/calendarlocal.cpp
parent2be8214908c52298ba79c8058d340edca5a8b417 (diff)
downloadkdepimpi-4f3ff02932b39bf16b9692c3cb69c101a28b4616.zip
kdepimpi-4f3ff02932b39bf16b9692c3cb69c101a28b4616.tar.gz
kdepimpi-4f3ff02932b39bf16b9692c3cb69c101a28b4616.tar.bz2
fixx
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
@@ -65,9 +65,47 @@ void CalendarLocal::init()
65 65
66CalendarLocal::~CalendarLocal() 66CalendarLocal::~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 )
72{ 110{
73 FileStorage storage( this, fileName ); 111 FileStorage storage( this, fileName );
@@ -756,6 +794,20 @@ void CalendarLocal::setCalendarEnabled( int id, bool enable )
756 if ( it->calID() == id ) it->setCalEnabled( enable ); 794 if ( it->calID() == id ) it->setCalEnabled( enable );
757 795
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 )
760{ 812{
761 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) 813 for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() )