summaryrefslogtreecommitdiffabout
path: root/libkcal
Unidiff
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/incidence.cpp11
-rw-r--r--libkcal/incidence.h2
2 files changed, 12 insertions, 1 deletions
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index f446197..4382416 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -445,16 +445,27 @@ Incidence *Incidence::relatedTo() const
445 return mRelatedTo; 445 return mRelatedTo;
446} 446}
447 447
448QPtrList<Incidence> Incidence::relations() const 448QPtrList<Incidence> Incidence::relations() const
449{ 449{
450 return mRelations; 450 return mRelations;
451} 451}
452 452
453void Incidence::addRelationsToList(QPtrList<Incidence> *rel)
454{
455 Incidence* inc;
456 QPtrList<Incidence> Relations = relations();
457 for (inc=Relations.first();inc;inc=Relations.next()) {
458 inc->addRelationsToList( rel );
459 }
460 if ( rel->findRef( this ) == -1 )
461 rel->append( this );
462}
463
453void Incidence::addRelation(Incidence *event) 464void Incidence::addRelation(Incidence *event)
454{ 465{
455 if( mRelations.findRef( event ) == -1 ) { 466 if( mRelations.findRef( event ) == -1 ) {
456 mRelations.append(event); 467 mRelations.append(event);
457 //updated(); 468 //updated();
458 } 469 }
459} 470}
460 471
diff --git a/libkcal/incidence.h b/libkcal/incidence.h
index aa51e84..fc97ce9 100644
--- a/libkcal/incidence.h
+++ b/libkcal/incidence.h
@@ -108,17 +108,17 @@ class Incidence : public IncidenceBase
108 <pre> 108 <pre>
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 virtual void cloneRelations( Incidence * );
116 116 void addRelationsToList(QPtrList<Incidence> *rel);
117 virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0; 117 virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0;
118 void setReadOnly( bool ); 118 void setReadOnly( bool );
119 119
120 /** 120 /**
121 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
122 event information is preserved. Sets uniquie id, creation date, last 122 event information is preserved. Sets uniquie id, creation date, last
123 modification date and revision number. 123 modification date and revision number.
124 */ 124 */