summaryrefslogtreecommitdiffabout
path: root/libkcal
authorzautrix <zautrix>2005-04-10 13:17:21 (UTC)
committer zautrix <zautrix>2005-04-10 13:17:21 (UTC)
commitef11b9d4de01d601bfcfb8efacb0aeff1e657edb (patch) (unidiff)
tree5f4e6aa51ef357c6d9ecbe4d9a2908b8c2ca1228 /libkcal
parent04fe8f3523c46511e846a42e4bb92d6b8d33758b (diff)
downloadkdepimpi-ef11b9d4de01d601bfcfb8efacb0aeff1e657edb.zip
kdepimpi-ef11b9d4de01d601bfcfb8efacb0aeff1e657edb.tar.gz
kdepimpi-ef11b9d4de01d601bfcfb8efacb0aeff1e657edb.tar.bz2
fix
Diffstat (limited to 'libkcal') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/calendar.cpp10
-rw-r--r--libkcal/calendar.h3
-rw-r--r--libkcal/incidence.cpp14
-rw-r--r--libkcal/incidence.h1
4 files changed, 26 insertions, 2 deletions
diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp
index 406cd48..ed39ddb 100644
--- a/libkcal/calendar.cpp
+++ b/libkcal/calendar.cpp
@@ -332,13 +332,21 @@ QPtrList<Event> Calendar::events( const QDate &start, const QDate &end,
332QPtrList<Event> Calendar::events() 332QPtrList<Event> Calendar::events()
333{ 333{
334 QPtrList<Event> el = rawEvents(); 334 QPtrList<Event> el = rawEvents();
335 mFilter->apply(&el); 335 mFilter->apply(&el);
336 return el; 336 return el;
337} 337}
338 338void Calendar::addIncidenceBranch(Incidence *i)
339{
340 addIncidence( i );
341 Incidence * inc;
342 QPtrList<Incidence> Relations = i->relations();
343 for (inc=Relations.first();inc;inc=Relations.next()) {
344 addIncidenceBranch( inc );
345 }
346}
339 347
340bool Calendar::addIncidence(Incidence *i) 348bool Calendar::addIncidence(Incidence *i)
341{ 349{
342 Incidence::AddVisitor<Calendar> v(this); 350 Incidence::AddVisitor<Calendar> v(this);
343 351
344 return i->accept(v); 352 return i->accept(v);
diff --git a/libkcal/calendar.h b/libkcal/calendar.h
index 2f2c3aa..ab40970 100644
--- a/libkcal/calendar.h
+++ b/libkcal/calendar.h
@@ -137,12 +137,15 @@ public:
137 /** 137 /**
138 Add an incidence to calendar. 138 Add an incidence to calendar.
139 139
140 @return true on success, false on error. 140 @return true on success, false on error.
141 */ 141 */
142 virtual bool addIncidence( Incidence * ); 142 virtual bool addIncidence( Incidence * );
143
144 // Adds an incidence and all relatedto incidences to the cal
145 void addIncidenceBranch( Incidence * );
143 /** 146 /**
144 Return filtered list of all incidences of this calendar. 147 Return filtered list of all incidences of this calendar.
145 */ 148 */
146 virtual QPtrList<Incidence> incidences(); 149 virtual QPtrList<Incidence> incidences();
147 150
148 /** 151 /**
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index 6bca12c..78fa24f 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -260,13 +260,25 @@ void Incidence::recreate()
260 setUid(CalFormat::createUniqueId()); 260 setUid(CalFormat::createUniqueId());
261 261
262 setRevision(0); 262 setRevision(0);
263 setIDStr( ":" ); 263 setIDStr( ":" );
264 setLastModified(QDateTime::currentDateTime()); 264 setLastModified(QDateTime::currentDateTime());
265} 265}
266 266void Incidence::cloneRelations( Incidence * newInc )
267{
268 // newInc is already a clone of this incidence
269 Incidence * inc;
270 Incidence * cloneInc;
271 QPtrList<Incidence> Relations = relations();
272 for (inc=Relations.first();inc;inc=Relations.next()) {
273 cloneInc = inc->clone();
274 cloneInc->recreate();
275 cloneInc->setRelatedTo( newInc );
276 inc->cloneRelations( cloneInc );
277 }
278}
267void Incidence::setReadOnly( bool readOnly ) 279void Incidence::setReadOnly( bool readOnly )
268{ 280{
269 IncidenceBase::setReadOnly( readOnly ); 281 IncidenceBase::setReadOnly( readOnly );
270 recurrence()->setRecurReadOnly( readOnly); 282 recurrence()->setRecurReadOnly( readOnly);
271} 283}
272 284
diff --git a/libkcal/incidence.h b/libkcal/incidence.h
index f8da342..60070a2 100644
--- a/libkcal/incidence.h
+++ b/libkcal/incidence.h
@@ -109,12 +109,13 @@ class Incidence : public IncidenceBase
109 bool accept(Visitor &v) { return v.visit(this); } 109 bool accept(Visitor &v) { return v.visit(this); }
110 </pre> 110 </pre>
111 */ 111 */
112 virtual bool accept(Visitor &) { return false; } 112 virtual bool accept(Visitor &) { return false; }
113 113
114 virtual Incidence *clone() = 0; 114 virtual Incidence *clone() = 0;
115 virtual void cloneRelations( Incidence * );
115 116
116 virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const = 0; 117 virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const = 0;
117 void setReadOnly( bool ); 118 void setReadOnly( bool );
118 119
119 /** 120 /**
120 Recreate event. The event is made a new unique event, but already stored 121 Recreate event. The event is made a new unique event, but already stored