summaryrefslogtreecommitdiffabout
path: root/libkcal/calendarlocal.cpp
Unidiff
Diffstat (limited to 'libkcal/calendarlocal.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/calendarlocal.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index 00a43e5..e75df70 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -61,48 +61,52 @@ void CalendarLocal::init()
61{ 61{
62 mNextAlarmIncidence = 0; 62 mNextAlarmIncidence = 0;
63} 63}
64 64
65 65
66CalendarLocal::~CalendarLocal() 66CalendarLocal::~CalendarLocal()
67{ 67{
68 close(); 68 close();
69} 69}
70 70
71bool CalendarLocal::load( const QString &fileName ) 71bool CalendarLocal::load( const QString &fileName )
72{ 72{
73 FileStorage storage( this, fileName ); 73 FileStorage storage( this, fileName );
74 return storage.load(); 74 return storage.load();
75} 75}
76 76
77bool CalendarLocal::save( const QString &fileName, CalFormat *format ) 77bool CalendarLocal::save( const QString &fileName, CalFormat *format )
78{ 78{
79 FileStorage storage( this, fileName, format ); 79 FileStorage storage( this, fileName, format );
80 return storage.save(); 80 return storage.save();
81} 81}
82 82
83void CalendarLocal::close() 83void CalendarLocal::close()
84{ 84{
85
86 Todo * i;
87 for( i = mTodoList.first(); i; i = mTodoList.next() ) i->setRunning(false);
88
85 mEventList.setAutoDelete( true ); 89 mEventList.setAutoDelete( true );
86 mTodoList.setAutoDelete( true ); 90 mTodoList.setAutoDelete( true );
87 mJournalList.setAutoDelete( false ); 91 mJournalList.setAutoDelete( false );
88 92
89 mEventList.clear(); 93 mEventList.clear();
90 mTodoList.clear(); 94 mTodoList.clear();
91 mJournalList.clear(); 95 mJournalList.clear();
92 96
93 mEventList.setAutoDelete( false ); 97 mEventList.setAutoDelete( false );
94 mTodoList.setAutoDelete( false ); 98 mTodoList.setAutoDelete( false );
95 mJournalList.setAutoDelete( false ); 99 mJournalList.setAutoDelete( false );
96 100
97 setModified( false ); 101 setModified( false );
98} 102}
99 103
100bool CalendarLocal::addAnniversaryNoDup( Event *event ) 104bool CalendarLocal::addAnniversaryNoDup( Event *event )
101{ 105{
102 QString cat; 106 QString cat;
103 bool isBirthday = true; 107 bool isBirthday = true;
104 if( event->categoriesStr() == i18n( "Anniversary" ) ) { 108 if( event->categoriesStr() == i18n( "Anniversary" ) ) {
105 isBirthday = false; 109 isBirthday = false;
106 cat = i18n( "Anniversary" ); 110 cat = i18n( "Anniversary" );
107 } else if( event->categoriesStr() == i18n( "Birthday" ) ) { 111 } else if( event->categoriesStr() == i18n( "Birthday" ) ) {
108 isBirthday = true; 112 isBirthday = true;