summaryrefslogtreecommitdiff
path: root/library/backend/event.cpp
Unidiff
Diffstat (limited to 'library/backend/event.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/backend/event.cpp539
1 files changed, 512 insertions, 27 deletions
diff --git a/library/backend/event.cpp b/library/backend/event.cpp
index 50a663d..7110717 100644
--- a/library/backend/event.cpp
+++ b/library/backend/event.cpp
@@ -1,5 +1,5 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2001 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
@@ -20,7 +20,7 @@
20 20
21#include "event.h" 21#include "event.h"
22#include "qfiledirect_p.h" 22#include "qfiledirect_p.h"
23#include <qpe/timeconversion.h> 23#include <qtopia/timeconversion.h>
24#include <qpe/stringutil.h> 24#include <qtopia/stringutil.h>
25#include <qpe/recordfields.h> 25#include <qtopia/private/recordfields.h>
26#include <qbuffer.h> 26#include <qbuffer.h>
@@ -73,2 +73,251 @@ Qtopia::UidGen Event::sUidGen( Qtopia::UidGen::Qtopia );
73 73
74/*!
75 \class Event event.h
76 \brief The Event class holds the data of a calendar event.
77
78 This data includes descriptive data of the event and schedualing information.
79
80 \ingroup qtopiaemb
81 \ingroup qtopiadesktop
82*/
83
84/*!
85 \class Event::RepeatPattern
86 \class The Event::RepeatPattern class is internal.
87 \internal
88*/
89
90/*!
91 \enum Event::Days
92 \internal
93*/
94
95/*!
96 \enum Event::Type
97 \internal
98*/
99
100/*!
101 \enum Event::SoundTypeChoice
102
103 This enum type defines what kind of sound is made when an alarm occurs
104 for an event. The currently defined types are:
105
106 <ul>
107 <li>\c Silent - No sound is produced.
108 <li>\c Loud - A loud sound is produced.
109 </ul>
110*/
111
112/*!
113 \fn bool Event::operator<( const Event & ) const
114 \internal
115*/
116
117/*!
118 \fn bool Event::operator<=( const Event & ) const
119 \internal
120*/
121
122/*!
123 \fn bool Event::operator!=( const Event & ) const
124 \internal
125*/
126
127/*!
128 \fn bool Event::operator>( const Event & ) const
129 \internal
130*/
131
132/*!
133 \fn bool Event::operator>=( const Event & ) const
134 \internal
135*/
136
137/*!
138 \enum Event::RepeatType
139
140 This enum defines how a event will repeat, if at all.
141
142 <ul>
143 <li>\c NoRepeat - Event does not repeat.
144 <li>\c Daily - Event occurs every n days.
145 <li>\c Weekly - Event occurs every n weeks.
146 <li>\c MonthlyDay - Event occurs every n months. Event will always occur in
147 the same week and same day of week as the first event.
148 <li>\c MonthlyDate - Event occurs every n months. Event will always occur
149 on the same day of the month as the first event.
150 <li>\c Yearly - Event occurs every n years.
151 </ul>
152*/
153
154/*!
155 \fn bool Event::isAllDay() const
156
157 Returns TRUE if the event is an all day event. Otherwise returns FALSE.
158*/
159
160/*!
161 \fn void Event::setAllDay(bool allday)
162
163 If \a allday is TRUE, will set the event to be an all day event.
164 Otherwise sets the event to not be an all day event.
165
166 \warning This function may affect the start and end times of the event.
167*/
168
169/*!
170 \fn QDateTime Event::start() const
171
172 Returns the start date and time of the first occurance of the event.
173*/
174
175/*!
176 \fn QDateTime Event::end() const
177
178 Returns the end date and time of the first occurance of the event.
179*/
180
181/*!
182 \fn time_t Event::startTime() const
183 \internal
184*/
185
186/*!
187 \fn time_t Event::endTime() const
188 \internal
189*/
190
191/*!
192 \fn void Event::setAlarm(int delay, SoundTypeChoice s)
193
194 Sets the alarm delay of the event to \a delay and the sound type of the
195 alarm to \a s.
196*/
197
198/*!
199 \fn void Event::clearAlarm()
200
201 Clears the alarm for the event.
202*/
203
204/*!
205 \fn int Event::alarmDelay() const
206
207 Returns the delay in minutes between the alarm for an event and the
208 start of the event.
209*/
210
211/*!
212 \fn Event::RepeatType Event::repeatType() const
213
214 Returns the repeat pattern type for the event.
215
216 \sa frequency()
217*/
218
219/*!
220 \fn int Event::weekOffset() const
221
222 Returns the number of weeks from the start of the month that this event
223 occurs.
224*/
225
226/*!
227 \fn QDate Event::repeatTill() const
228
229 Returns the date that the event will continue to repeat until. If the event
230 repeats forever the value returned is undefined.
231
232 \sa repeatForever()
233*/
234
235/*!
236 \fn bool Event::repeatForever() const
237
238 Returns FALSE if there is a date set for the event to continue until.
239 Otherwise returns TRUE.
240*/
241
242/*!
243 \fn bool Event::doRepeat() const
244 \internal
245*/
246
247/*!
248 \fn bool Event::repeatOnWeekDay(int day) const
249
250 Returns TRUE if the event has a RepeatType of Weekly and is set to occur on
251 \a day each week. Otherwise returns FALSE.
252
253 \sa QDate::dayName()
254*/
255
256/*!
257 \fn void Event::setRepeatOnWeekDay(int day, bool enable)
258
259 If \a enable is TRUE then sets the event to occur on \a day each week.
260 Otherwise sets the event not to occur on \a day.
261
262 \warning this function is only relavent for a event with RepeatType of
263 Weekly.
264
265 \sa QDate::dayName()
266*/
267
268/*!
269 \fn int Event::frequency() const
270
271 Returns how often the event repeats.
272
273 \sa repeatType()
274*/
275
276/*!
277 \fn void Event::setRepeatType(RepeatType t)
278
279 Sets the repeat pattern type of the event to \a t.
280
281 \sa setFrequency()
282*/
283
284/*!
285 \fn void Event::setFrequency(int n)
286
287 Sets how often the event occurs with in its repeat pattern.
288
289 \sa setRepeatType()
290*/
291
292/*!
293 \fn void Event::setRepeatTill(const QDate &d)
294
295 Sets the event to repeat until \a d.
296*/
297
298/*!
299 \fn void Event::setRepeatForever(bool enable)
300
301 If \a enable is TRUE, sets the event to repeat forever. Otherwise
302 sets the event to stop repeating at some date.
303
304 \warning This function may affect the specific date the event will repeat
305 till.
306*/
307
308/*!
309 \fn bool Event::match(const QRegExp &r) const
310
311 Returns TRUE if the event matches the regular expression \a r.
312 Otherwise returns FALSE.
313*/
314
315/*!
316 \fn char Event::day(int)
317 \internal
318*/
319
320/*!
321 Creates a new, empty event.
322*/
74Event::Event() : Record() 323Event::Event() : Record()
@@ -85,2 +334,5 @@ Event::Event() : Record()
85 334
335/*!
336 \internal
337*/
86Event::Event( const QMap<int, QString> &map ) 338Event::Event( const QMap<int, QString> &map )
@@ -108,2 +360,5 @@ Event::Event( const QMap<int, QString> &map )
108 360
361/*!
362 Destroys an event.
363*/
109Event::~Event() 364Event::~Event()
@@ -112,2 +367,5 @@ Event::~Event()
112 367
368/*!
369 \internal
370*/
113int Event::week( const QDate& date ) 371int Event::week( const QDate& date )
@@ -126,2 +384,5 @@ int Event::week( const QDate& date )
126 384
385/*!
386 \internal
387*/
127int Event::occurrence( const QDate& date ) 388int Event::occurrence( const QDate& date )
@@ -133,2 +394,5 @@ int Event::occurrence( const QDate& date )
133 394
395/*!
396 \internal
397*/
134int Event::dayOfWeek( char day ) 398int Event::dayOfWeek( char day )
@@ -144,2 +408,5 @@ int Event::dayOfWeek( char day )
144 408
409/*!
410 \internal
411*/
145int Event::monthDiff( const QDate& first, const QDate& second ) 412int Event::monthDiff( const QDate& first, const QDate& second )
@@ -150,2 +417,5 @@ int Event::monthDiff( const QDate& first, const QDate& second )
150 417
418/*!
419 \internal
420*/
151QMap<int, QString> Event::toMap() const 421QMap<int, QString> Event::toMap() const
@@ -153,7 +423,14 @@ QMap<int, QString> Event::toMap() const
153 QMap<int, QString> m; 423 QMap<int, QString> m;
154 m.insert( DatebookDescription, description() ); 424
155 m.insert ( Location, location() ); 425 if ( !description().isEmpty() )
156 m.insert ( DatebookCategory, idsToString( categories() ) ); 426 m.insert( DatebookDescription, description() );
157 m.insert ( TimeZone, timeZone() ); 427 if ( !location().isEmpty() )
158 m.insert ( Note, notes() ); 428 m.insert ( Location, location() );
429 if ( categories().count() )
430 m.insert ( DatebookCategory, idsToString( categories() ) );
431 if ( !timeZone().isEmpty() )
432 m.insert ( TimeZone, timeZone() );
433 if ( !notes().isEmpty() )
434 m.insert ( Note, notes() );
435
159 m.insert ( StartDateTime, QString::number( TimeConversion::toUTC( start() ) ) ); 436 m.insert ( StartDateTime, QString::number( TimeConversion::toUTC( start() ) ) );
@@ -176,2 +453,5 @@ QMap<int, QString> Event::toMap() const
176 453
454/*!
455 \internal
456*/
177void Event::setRepeat( const RepeatPattern &p ) 457void Event::setRepeat( const RepeatPattern &p )
@@ -181,2 +461,5 @@ void Event::setRepeat( const RepeatPattern &p )
181 461
462/*!
463 Sets the description of the event to \a s.
464*/
182void Event::setDescription( const QString &s ) 465void Event::setDescription( const QString &s )
@@ -186,2 +469,5 @@ void Event::setDescription( const QString &s )
186 469
470/*!
471 Sets the location of the event to \a s.
472*/
187void Event::setLocation( const QString &s ) 473void Event::setLocation( const QString &s )
@@ -196,2 +482,5 @@ void Event::setLocation( const QString &s )
196 482
483/*!
484 \internal
485*/
197void Event::setType( Type t ) 486void Event::setType( Type t )
@@ -201,2 +490,6 @@ void Event::setType( Type t )
201 490
491/*!
492 Sets the start date and time of the first or only occurance of this event
493 to the date and time \a d. \a d should be in local time.
494*/
202void Event::setStart( const QDateTime &d ) 495void Event::setStart( const QDateTime &d )
@@ -206,2 +499,5 @@ void Event::setStart( const QDateTime &d )
206 499
500/*!
501 \internal
502*/
207void Event::setStart( time_t time ) 503void Event::setStart( time_t time )
@@ -211,2 +507,6 @@ void Event::setStart( time_t time )
211 507
508/*!
509 Sets the end date and time of the first or only occurance of this event
510 to the date and time \a d. \a d should be in local time.
511*/
212void Event::setEnd( const QDateTime &d ) 512void Event::setEnd( const QDateTime &d )
@@ -216,2 +516,5 @@ void Event::setEnd( const QDateTime &d )
216 516
517/*!
518 \internal
519*/
217void Event::setEnd( time_t time ) 520void Event::setEnd( time_t time )
@@ -221,2 +524,5 @@ void Event::setEnd( time_t time )
221 524
525/*!
526 \internal
527*/
222void Event::setTimeZone( const QString &z ) 528void Event::setTimeZone( const QString &z )
@@ -226,2 +532,5 @@ void Event::setTimeZone( const QString &z )
226 532
533/*!
534 \internal
535*/
227void Event::setAlarm( bool b, int minutes, SoundTypeChoice s ) 536void Event::setAlarm( bool b, int minutes, SoundTypeChoice s )
@@ -233,2 +542,5 @@ void Event::setAlarm( bool b, int minutes, SoundTypeChoice s )
233 542
543/*!
544 \internal
545*/
234void Event::setRepeat( bool b, const RepeatPattern &p ) 546void Event::setRepeat( bool b, const RepeatPattern &p )
@@ -239,2 +551,5 @@ void Event::setRepeat( bool b, const RepeatPattern &p )
239 551
552/*!
553 Sets the notes for the event to \a n.
554*/
240void Event::setNotes( const QString &n ) 555void Event::setNotes( const QString &n )
@@ -244,2 +559,5 @@ void Event::setNotes( const QString &n )
244 559
560/*!
561 Returns the description of the event.
562*/
245const QString &Event::description() const 563const QString &Event::description() const
@@ -249,2 +567,5 @@ const QString &Event::description() const
249 567
568/*!
569 Returns the location of the event.
570*/
250const QString &Event::location() const 571const QString &Event::location() const
@@ -259,2 +580,5 @@ const QString &Event::location() const
259 580
581/*!
582 \internal
583*/
260Event::Type Event::type() const 584Event::Type Event::type() const
@@ -264,2 +588,5 @@ Event::Type Event::type() const
264 588
589/*!
590 \internal
591*/
265QDateTime Event::start( bool actual ) const 592QDateTime Event::start( bool actual ) const
@@ -276,2 +603,5 @@ QDateTime Event::start( bool actual ) const
276 603
604/*!
605 \internal
606*/
277QDateTime Event::end( bool actual ) const 607QDateTime Event::end( bool actual ) const
@@ -288,2 +618,5 @@ QDateTime Event::end( bool actual ) const
288 618
619/*!
620 \internal
621*/
289const QString &Event::timeZone() const 622const QString &Event::timeZone() const
@@ -293,2 +626,5 @@ const QString &Event::timeZone() const
293 626
627/*!
628 \internal
629*/
294bool Event::hasAlarm() const 630bool Event::hasAlarm() const
@@ -298,2 +634,5 @@ bool Event::hasAlarm() const
298 634
635/*!
636 \internal
637*/
299int Event::alarmTime() const 638int Event::alarmTime() const
@@ -303,2 +642,5 @@ int Event::alarmTime() const
303 642
643/*!
644 Returns the sound type for the alarm of this event.
645*/
304Event::SoundTypeChoice Event::alarmSound() const 646Event::SoundTypeChoice Event::alarmSound() const
@@ -308,2 +650,5 @@ Event::SoundTypeChoice Event::alarmSound() const
308 650
651/*!
652 \internal
653*/
309bool Event::hasRepeat() const 654bool Event::hasRepeat() const
@@ -313,2 +658,5 @@ bool Event::hasRepeat() const
313 658
659/*!
660 \internal
661*/
314const Event::RepeatPattern &Event::repeatPattern() const 662const Event::RepeatPattern &Event::repeatPattern() const
@@ -318,2 +666,5 @@ const Event::RepeatPattern &Event::repeatPattern() const
318 666
667/*!
668 \internal
669*/
319Event::RepeatPattern &Event::repeatPattern() 670Event::RepeatPattern &Event::repeatPattern()
@@ -323,2 +674,5 @@ Event::RepeatPattern &Event::repeatPattern()
323 674
675/*!
676 Returns the notes for the event.
677*/
324const QString &Event::notes() const 678const QString &Event::notes() const
@@ -328,4 +682,9 @@ const QString &Event::notes() const
328 682
683/*!
684 \internal
685*/
329bool Event::operator==( const Event &e ) const 686bool Event::operator==( const Event &e ) const
330{ 687{
688 if ( uid() && e.uid() == uid() )
689 return TRUE;
331 return ( e.descript == descript && 690 return ( e.descript == descript &&
@@ -345,2 +704,6 @@ bool Event::operator==( const Event &e ) const
345 704
705/*!
706 \internal
707 Appends the contact information to \a buf.
708*/
346void Event::save( QString& buf ) 709void Event::save( QString& buf )
@@ -380,2 +743,5 @@ void Event::save( QString& buf )
380 743
744/*!
745 \internal
746*/
381bool Event::RepeatPattern::operator==( const Event::RepeatPattern &right ) const 747bool Event::RepeatPattern::operator==( const Event::RepeatPattern &right ) const
@@ -392,2 +758,24 @@ bool Event::RepeatPattern::operator==( const Event::RepeatPattern &right ) const
392 758
759/*!
760 \class EffectiveEvent
761 \brief The EffectiveEvent class the data for a single occurance of an event.
762
763 This class describes the event for a single occurance of it. For example if
764 an Event occurs every week, the effective event might represent the third
765 occurance of this Event.
766
767 \ingroup qtopiaemb
768 \ingroup qtopiadesktop
769 \warning This class will be phased out in Qtopia 3.x
770*/
771
772/*!
773 \enum EffectiveEvent::Position
774 \internal
775*/
776
777/*!
778 \fn EffectiveEvent &EffectiveEvent::operator=(const EffectiveEvent &)
779 \internal
780*/
393 781
@@ -402,3 +790,5 @@ public:
402 790
403 791/*!
792 \internal
793*/
404EffectiveEvent::EffectiveEvent() 794EffectiveEvent::EffectiveEvent()
@@ -410,2 +800,5 @@ EffectiveEvent::EffectiveEvent()
410 800
801/*!
802 \internal
803*/
411EffectiveEvent::EffectiveEvent( const Event &e, const QDate &date, Position pos ) 804EffectiveEvent::EffectiveEvent( const Event &e, const QDate &date, Position pos )
@@ -426,2 +819,5 @@ EffectiveEvent::EffectiveEvent( const Event &e, const QDate &date, Position pos
426 819
820/*!
821 \internal
822*/
427EffectiveEvent::~EffectiveEvent() 823EffectiveEvent::~EffectiveEvent()
@@ -431,2 +827,5 @@ EffectiveEvent::~EffectiveEvent()
431 827
828/*!
829 \internal
830*/
432EffectiveEvent::EffectiveEvent( const EffectiveEvent &e ) 831EffectiveEvent::EffectiveEvent( const EffectiveEvent &e )
@@ -463,2 +862,5 @@ EffectiveEvent& EffectiveEvent::operator=( const EffectiveEvent & e )
463 862
863/*!
864 Returns the description of the event for this effective event.
865*/
464const QString &EffectiveEvent::description( ) const 866const QString &EffectiveEvent::description( ) const
@@ -468,2 +870,5 @@ const QString &EffectiveEvent::description( ) const
468 870
871/*!
872\internal
873*/
469const QString &EffectiveEvent::location( ) const 874const QString &EffectiveEvent::location( ) const
@@ -473,2 +878,5 @@ const QString &EffectiveEvent::location( ) const
473 878
879/*!
880\internal
881*/
474const QString &EffectiveEvent::notes() const 882const QString &EffectiveEvent::notes() const
@@ -478,2 +886,5 @@ const QString &EffectiveEvent::notes() const
478 886
887/*!
888 Returns the event associated with this effective event.
889*/
479const Event &EffectiveEvent::event() const 890const Event &EffectiveEvent::event() const
@@ -483,2 +894,5 @@ const Event &EffectiveEvent::event() const
483 894
895/*!
896 \internal
897*/
484const QTime &EffectiveEvent::end() const 898const QTime &EffectiveEvent::end() const
@@ -488,2 +902,5 @@ const QTime &EffectiveEvent::end() const
488 902
903/*!
904 \internal
905*/
489const QTime &EffectiveEvent::start() const 906const QTime &EffectiveEvent::start() const
@@ -493,2 +910,5 @@ const QTime &EffectiveEvent::start() const
493 910
911/*!
912 Returns the date the effective event occurs on.
913*/
494const QDate &EffectiveEvent::date() const 914const QDate &EffectiveEvent::date() const
@@ -498,2 +918,5 @@ const QDate &EffectiveEvent::date() const
498 918
919/*!
920 \internal
921*/
499int EffectiveEvent::length() const 922int EffectiveEvent::length() const
@@ -504,2 +927,5 @@ int EffectiveEvent::length() const
504 927
928/*!
929 \internal
930*/
505void EffectiveEvent::setDate( const QDate &dt ) 931void EffectiveEvent::setDate( const QDate &dt )
@@ -509,2 +935,5 @@ void EffectiveEvent::setDate( const QDate &dt )
509 935
936/*!
937 \internal
938*/
510void EffectiveEvent::setStart( const QTime &start ) 939void EffectiveEvent::setStart( const QTime &start )
@@ -514,2 +943,5 @@ void EffectiveEvent::setStart( const QTime &start )
514 943
944/*!
945 \internal
946*/
515void EffectiveEvent::setEnd( const QTime &end ) 947void EffectiveEvent::setEnd( const QTime &end )
@@ -519,2 +951,5 @@ void EffectiveEvent::setEnd( const QTime &end )
519 951
952/*!
953 \internal
954*/
520void EffectiveEvent::setEvent( Event e ) 955void EffectiveEvent::setEvent( Event e )
@@ -524,2 +959,5 @@ void EffectiveEvent::setEvent( Event e )
524 959
960/*!
961 \internal
962*/
525bool EffectiveEvent::operator<( const EffectiveEvent &e ) const 963bool EffectiveEvent::operator<( const EffectiveEvent &e ) const
@@ -534,2 +972,5 @@ bool EffectiveEvent::operator<( const EffectiveEvent &e ) const
534 972
973/*!
974 \internal
975*/
535bool EffectiveEvent::operator<=( const EffectiveEvent &e ) const 976bool EffectiveEvent::operator<=( const EffectiveEvent &e ) const
@@ -539,2 +980,5 @@ bool EffectiveEvent::operator<=( const EffectiveEvent &e ) const
539 980
981/*!
982 \internal
983*/
540bool EffectiveEvent::operator==( const EffectiveEvent &e ) const 984bool EffectiveEvent::operator==( const EffectiveEvent &e ) const
@@ -547,2 +991,5 @@ bool EffectiveEvent::operator==( const EffectiveEvent &e ) const
547 991
992/*!
993 \internal
994*/
548bool EffectiveEvent::operator!=( const EffectiveEvent &e ) const 995bool EffectiveEvent::operator!=( const EffectiveEvent &e ) const
@@ -552,2 +999,5 @@ bool EffectiveEvent::operator!=( const EffectiveEvent &e ) const
552 999
1000/*!
1001 \internal
1002*/
553bool EffectiveEvent::operator>( const EffectiveEvent &e ) const 1003bool EffectiveEvent::operator>( const EffectiveEvent &e ) const
@@ -557,2 +1007,5 @@ bool EffectiveEvent::operator>( const EffectiveEvent &e ) const
557 1007
1008/*!
1009 \internal
1010*/
558bool EffectiveEvent::operator>=(const EffectiveEvent &e) const 1011bool EffectiveEvent::operator>=(const EffectiveEvent &e) const
@@ -562,2 +1015,5 @@ bool EffectiveEvent::operator>=(const EffectiveEvent &e) const
562 1015
1016/*!
1017 \internal
1018*/
563void EffectiveEvent::setEffectiveDates( const QDate &from, const QDate &to ) 1019void EffectiveEvent::setEffectiveDates( const QDate &from, const QDate &to )
@@ -575,2 +1031,5 @@ void EffectiveEvent::setEffectiveDates( const QDate &from, const QDate &to )
575 1031
1032/*!
1033 \internal
1034*/
576QDate EffectiveEvent::startDate() const 1035QDate EffectiveEvent::startDate() const
@@ -585,2 +1044,5 @@ QDate EffectiveEvent::startDate() const
585 1044
1045/*!
1046 \internal
1047*/
586QDate EffectiveEvent::endDate() const 1048QDate EffectiveEvent::endDate() const
@@ -595,2 +1057,5 @@ QDate EffectiveEvent::endDate() const
595 1057
1058/*!
1059 \internal
1060*/
596int EffectiveEvent::size() const 1061int EffectiveEvent::size() const
@@ -742,10 +1207,18 @@ static Event parseVObject( VObject *obj )
742 1207
743 1208/*!
1209 Writes the list of \a events as a set of VCards to the file \a filename.
1210*/
744void Event::writeVCalendar( const QString &filename, const QValueList<Event> &events) 1211void Event::writeVCalendar( const QString &filename, const QValueList<Event> &events)
745{ 1212{
746 QFileDirect f( filename.utf8().data() ); 1213
747 if ( !f.open( IO_WriteOnly ) ) { 1214 QFileDirect f( filename.utf8().data() );
748 qWarning("Unable to open vcard write"); 1215
749 return; 1216 if ( !f.open( IO_WriteOnly ) ) {
750 } 1217
1218 qWarning("Unable to open vcard write");
1219
1220 return;
1221
1222 }
1223
751 1224
@@ -756,3 +1229,4 @@ void Event::writeVCalendar( const QString &filename, const QValueList<Event> &ev
756 cleanVObject( obj ); 1229 cleanVObject( obj );
757 } 1230 }
1231
758 1232
@@ -761,9 +1235,18 @@ void Event::writeVCalendar( const QString &filename, const QValueList<Event> &ev
761 1235
1236/*!
1237 Writes \a event as a VCard to the file \a filename.
1238*/
762void Event::writeVCalendar( const QString &filename, const Event &event) 1239void Event::writeVCalendar( const QString &filename, const Event &event)
763{ 1240{
764 QFileDirect f( filename.utf8().data() ); 1241
765 if ( !f.open( IO_WriteOnly ) ) { 1242 QFileDirect f( filename.utf8().data() );
766 qWarning("Unable to open vcard write"); 1243
767 return; 1244 if ( !f.open( IO_WriteOnly ) ) {
768 } 1245
1246 qWarning("Unable to open vcard write");
1247
1248 return;
1249
1250 }
1251
769 1252
@@ -776,3 +1259,5 @@ void Event::writeVCalendar( const QString &filename, const Event &event)
776 1259
777 1260/*!
1261 Returns the set of events read as VCards from the file \a filename.
1262*/
778QValueList<Event> Event::readVCalendar( const QString &filename ) 1263QValueList<Event> Event::readVCalendar( const QString &filename )