summaryrefslogtreecommitdiffabout
path: root/libkcal
Unidiff
Diffstat (limited to 'libkcal') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/calendarlocal.cpp1
-rw-r--r--libkcal/icalformat.cpp9
-rw-r--r--libkcal/icalformat.h3
-rw-r--r--libkcal/todo.cpp5
4 files changed, 14 insertions, 4 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index e37a7ad..eef8327 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -65,6 +65,7 @@ void CalendarLocal::init()
65 65
66CalendarLocal::~CalendarLocal() 66CalendarLocal::~CalendarLocal()
67{ 67{
68 registerObserver( 0 );
68 if ( mDeleteIncidencesOnClose ) 69 if ( mDeleteIncidencesOnClose )
69 close(); 70 close();
70} 71}
diff --git a/libkcal/icalformat.cpp b/libkcal/icalformat.cpp
index 5877406..6f3a799 100644
--- a/libkcal/icalformat.cpp
+++ b/libkcal/icalformat.cpp
@@ -50,8 +50,9 @@ extern "C" {
50 50
51using namespace KCal; 51using namespace KCal;
52 52
53ICalFormat::ICalFormat( ) 53ICalFormat::ICalFormat( bool pe )
54{ 54{
55 mProcessEvents = pe;
55 mImpl = new ICalFormatImpl( this ); 56 mImpl = new ICalFormatImpl( this );
56 tzOffsetMin = 0; 57 tzOffsetMin = 0;
57 //qDebug("new ICalFormat() "); 58 //qDebug("new ICalFormat() ");
@@ -189,8 +190,11 @@ QString ICalFormat::toString( Calendar *cal )
189 component = mImpl->writeTodo(qlt.current()); 190 component = mImpl->writeTodo(qlt.current());
190 icalcomponent_add_component(calendar,component); 191 icalcomponent_add_component(calendar,component);
191 //qDebug(" todos "); 192 //qDebug(" todos ");
193 if ( mProcessEvents ) {
194 //qDebug("mProcessEvents ");
192 qApp->processEvents(); 195 qApp->processEvents();
193 } 196 }
197 }
194 // events 198 // events
195 QPtrList<Event> events = cal->rawEvents(); 199 QPtrList<Event> events = cal->rawEvents();
196 Event *ev; 200 Event *ev;
@@ -198,6 +202,7 @@ QString ICalFormat::toString( Calendar *cal )
198 component = mImpl->writeEvent(ev); 202 component = mImpl->writeEvent(ev);
199 icalcomponent_add_component(calendar,component); 203 icalcomponent_add_component(calendar,component);
200 //qDebug("events "); 204 //qDebug("events ");
205 if ( mProcessEvents )
201 qApp->processEvents(); 206 qApp->processEvents();
202 } 207 }
203 208
@@ -208,11 +213,13 @@ QString ICalFormat::toString( Calendar *cal )
208 component = mImpl->writeJournal(j); 213 component = mImpl->writeJournal(j);
209 icalcomponent_add_component(calendar,component); 214 icalcomponent_add_component(calendar,component);
210 //qDebug("journals "); 215 //qDebug("journals ");
216 if ( mProcessEvents )
211 qApp->processEvents(); 217 qApp->processEvents();
212 } 218 }
213 const char *text; 219 const char *text;
214 QString ret =""; 220 QString ret ="";
215 text = icalcomponent_as_ical_string( calendar ); 221 text = icalcomponent_as_ical_string( calendar );
222 if ( mProcessEvents )
216 qApp->processEvents(); 223 qApp->processEvents();
217 224
218 // text = "BEGIN:VCALENDAR\nPRODID\n :-//K Desktop Environment//NONSGML libkcal 3.1//EN\nVERSION\n :2.0\nBEGIN:VEVENT\nDTSTAMP\n :20031231T213514Z\nORGANIZER\n :MAILTO:lutz@putz.de\nCREATED\n :20031231T213513Z\nUID\n :libkcal-1295166342.120\nSEQUENCE\n :0\nLAST-MODIFIED\n :20031231T213513Z\nSUMMARY\n :test1\nCLASS\n :PUBLIC\nPRIORITY\n :3\nDTSTART\n :20040101T090000Z\nDTEND\n :20040101T110000Z\nTRANSP\n :OPAQUE\nEND:VEVENT\nEND:VCALENDAR\n"; 225 // text = "BEGIN:VCALENDAR\nPRODID\n :-//K Desktop Environment//NONSGML libkcal 3.1//EN\nVERSION\n :2.0\nBEGIN:VEVENT\nDTSTAMP\n :20031231T213514Z\nORGANIZER\n :MAILTO:lutz@putz.de\nCREATED\n :20031231T213513Z\nUID\n :libkcal-1295166342.120\nSEQUENCE\n :0\nLAST-MODIFIED\n :20031231T213513Z\nSUMMARY\n :test1\nCLASS\n :PUBLIC\nPRIORITY\n :3\nDTSTART\n :20040101T090000Z\nDTEND\n :20040101T110000Z\nTRANSP\n :OPAQUE\nEND:VEVENT\nEND:VCALENDAR\n";
diff --git a/libkcal/icalformat.h b/libkcal/icalformat.h
index 485ab6e..a770dbb 100644
--- a/libkcal/icalformat.h
+++ b/libkcal/icalformat.h
@@ -40,7 +40,7 @@ class ICalFormatImpl;
40class ICalFormat : public CalFormat { 40class ICalFormat : public CalFormat {
41 public: 41 public:
42 /** Create new iCalendar format. */ 42 /** Create new iCalendar format. */
43 ICalFormat( ); 43 ICalFormat( bool pe = true);
44 virtual ~ICalFormat(); 44 virtual ~ICalFormat();
45 45
46 /** 46 /**
@@ -103,6 +103,7 @@ class ICalFormat : public CalFormat {
103 bool utc() const; 103 bool utc() const;
104 104
105 private: 105 private:
106 bool mProcessEvents;
106 ICalFormatImpl *mImpl; 107 ICalFormatImpl *mImpl;
107 QString mTimeZoneId; 108 QString mTimeZoneId;
108 QCString mTzString; 109 QCString mTzString;
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 4ada2d8..7bf756a 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -66,6 +66,7 @@ void Todo::setRunningFalse( QString s )
66 if ( ! mRunning ) 66 if ( ! mRunning )
67 return; 67 return;
68 mRunning = false; 68 mRunning = false;
69 if ( mRunSaveTimer )
69 mRunSaveTimer->stop(); 70 mRunSaveTimer->stop();
70 saveRunningInfoToFile( s ); 71 saveRunningInfoToFile( s );
71} 72}
@@ -139,7 +140,7 @@ void Todo::saveRunningInfoToFile( QString comment )
139 to->setDescription( "TT-Note: " + comment +"\n" + des ); 140 to->setDescription( "TT-Note: " + comment +"\n" + des );
140 } 141 }
141 cal.addIncidence( to ); 142 cal.addIncidence( to );
142 ICalFormat format; 143 ICalFormat format( false );
143 file = dir +"/" +file +".ics"; 144 file = dir +"/" +file +".ics";
144 format.save( &cal, file ); 145 format.save( &cal, file );
145 saveParents(); 146 saveParents();
@@ -167,7 +168,7 @@ void Todo::saveParents()
167 cal.setLocalTime(); 168 cal.setLocalTime();
168 Todo * par = (Todo *) to->clone(); 169 Todo * par = (Todo *) to->clone();
169 cal.addIncidence( par ); 170 cal.addIncidence( par );
170 ICalFormat format; 171 ICalFormat format( false );
171 format.save( &cal, file ); 172 format.save( &cal, file );
172 } 173 }
173 to->saveParents(); 174 to->saveParents();