summaryrefslogtreecommitdiffabout
path: root/libkcal/calendarlocal.cpp
Unidiff
Diffstat (limited to 'libkcal/calendarlocal.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calendarlocal.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 8c4dde1..18f1af8 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -118,64 +118,70 @@ void CalendarLocal::addCalendar( Calendar* cal )
118 while ( ev ) { 118 while ( ev ) {
119 ev->unRegisterObserver( cal ); 119 ev->unRegisterObserver( cal );
120 ev->registerObserver( this ); 120 ev->registerObserver( this );
121 mTodoList.append( ev ); 121 mTodoList.append( ev );
122 setupRelations( ev ); 122 setupRelations( ev );
123 ev = TodoList.next(); 123 ev = TodoList.next();
124 } 124 }
125 } 125 }
126 { 126 {
127 QPtrList<Journal> JournalList = cal->journals(); 127 QPtrList<Journal> JournalList = cal->journals();
128 Journal * ev = JournalList.first(); 128 Journal * ev = JournalList.first();
129 while ( ev ) { 129 while ( ev ) {
130 ev->unRegisterObserver( cal ); 130 ev->unRegisterObserver( cal );
131 ev->registerObserver( this ); 131 ev->registerObserver( this );
132 mJournalList.append( ev ); 132 mJournalList.append( ev );
133 ev = JournalList.next(); 133 ev = JournalList.next();
134 } 134 }
135 } 135 }
136 setModified( true ); 136 setModified( true );
137} 137}
138bool CalendarLocal::load( const QString &fileName ) 138bool CalendarLocal::load( const QString &fileName )
139{ 139{
140 FileStorage storage( this, fileName ); 140 FileStorage storage( this, fileName );
141 return storage.load(); 141 return storage.load();
142} 142}
143 143
144bool CalendarLocal::save( const QString &fileName, CalFormat *format ) 144bool CalendarLocal::save( const QString &fileName, CalFormat *format )
145{ 145{
146 FileStorage storage( this, fileName, format ); 146 FileStorage storage( this, fileName, format );
147 return storage.save(); 147 return storage.save();
148} 148}
149 149
150void CalendarLocal::stopAllTodos()
151{
152 for ( Todo *it = mTodoList.first(); it; it = mTodoList.next() )
153 it->setRunning( false );
154
155}
150void CalendarLocal::close() 156void CalendarLocal::close()
151{ 157{
152 158
153 Todo * i; 159 Todo * i;
154 for( i = mTodoList.first(); i; i = mTodoList.next() ) i->setRunning(false); 160 for( i = mTodoList.first(); i; i = mTodoList.next() ) i->setRunning(false);
155 161
156 mEventList.setAutoDelete( true ); 162 mEventList.setAutoDelete( true );
157 mTodoList.setAutoDelete( true ); 163 mTodoList.setAutoDelete( true );
158 mJournalList.setAutoDelete( false ); 164 mJournalList.setAutoDelete( false );
159 165
160 mEventList.clear(); 166 mEventList.clear();
161 mTodoList.clear(); 167 mTodoList.clear();
162 mJournalList.clear(); 168 mJournalList.clear();
163 169
164 mEventList.setAutoDelete( false ); 170 mEventList.setAutoDelete( false );
165 mTodoList.setAutoDelete( false ); 171 mTodoList.setAutoDelete( false );
166 mJournalList.setAutoDelete( false ); 172 mJournalList.setAutoDelete( false );
167 173
168 setModified( false ); 174 setModified( false );
169} 175}
170 176
171bool CalendarLocal::addAnniversaryNoDup( Event *event ) 177bool CalendarLocal::addAnniversaryNoDup( Event *event )
172{ 178{
173 QString cat; 179 QString cat;
174 bool isBirthday = true; 180 bool isBirthday = true;
175 if( event->categoriesStr() == i18n( "Anniversary" ) ) { 181 if( event->categoriesStr() == i18n( "Anniversary" ) ) {
176 isBirthday = false; 182 isBirthday = false;
177 cat = i18n( "Anniversary" ); 183 cat = i18n( "Anniversary" );
178 } else if( event->categoriesStr() == i18n( "Birthday" ) ) { 184 } else if( event->categoriesStr() == i18n( "Birthday" ) ) {
179 isBirthday = true; 185 isBirthday = true;
180 cat = i18n( "Birthday" ); 186 cat = i18n( "Birthday" );
181 } else { 187 } else {