author | zautrix <zautrix> | 2005-04-10 13:17:21 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-10 13:17:21 (UTC) |
commit | ef11b9d4de01d601bfcfb8efacb0aeff1e657edb (patch) (side-by-side diff) | |
tree | 5f4e6aa51ef357c6d9ecbe4d9a2908b8c2ca1228 /libkcal | |
parent | 04fe8f3523c46511e846a42e4bb92d6b8d33758b (diff) | |
download | kdepimpi-ef11b9d4de01d601bfcfb8efacb0aeff1e657edb.zip kdepimpi-ef11b9d4de01d601bfcfb8efacb0aeff1e657edb.tar.gz kdepimpi-ef11b9d4de01d601bfcfb8efacb0aeff1e657edb.tar.bz2 |
fix
-rw-r--r-- | libkcal/calendar.cpp | 10 | ||||
-rw-r--r-- | libkcal/calendar.h | 5 | ||||
-rw-r--r-- | libkcal/incidence.cpp | 14 | ||||
-rw-r--r-- | libkcal/incidence.h | 1 |
4 files changed, 27 insertions, 3 deletions
diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp index 406cd48..ed39ddb 100644 --- a/libkcal/calendar.cpp +++ b/libkcal/calendar.cpp @@ -337,3 +337,11 @@ QPtrList<Event> Calendar::events() } - +void Calendar::addIncidenceBranch(Incidence *i) +{ + addIncidence( i ); + Incidence * inc; + QPtrList<Incidence> Relations = i->relations(); + for (inc=Relations.first();inc;inc=Relations.next()) { + addIncidenceBranch( inc ); + } +} diff --git a/libkcal/calendar.h b/libkcal/calendar.h index 2f2c3aa..ab40970 100644 --- a/libkcal/calendar.h +++ b/libkcal/calendar.h @@ -141,3 +141,6 @@ public: */ - virtual bool addIncidence( Incidence * ); + virtual bool addIncidence( Incidence * ); + + // Adds an incidence and all relatedto incidences to the cal + void addIncidenceBranch( Incidence * ); /** diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 6bca12c..78fa24f 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp @@ -265,3 +265,15 @@ void Incidence::recreate() } - +void Incidence::cloneRelations( Incidence * newInc ) +{ + // newInc is already a clone of this incidence + Incidence * inc; + Incidence * cloneInc; + QPtrList<Incidence> Relations = relations(); + for (inc=Relations.first();inc;inc=Relations.next()) { + cloneInc = inc->clone(); + cloneInc->recreate(); + cloneInc->setRelatedTo( newInc ); + inc->cloneRelations( cloneInc ); + } +} void Incidence::setReadOnly( bool readOnly ) diff --git a/libkcal/incidence.h b/libkcal/incidence.h index f8da342..60070a2 100644 --- a/libkcal/incidence.h +++ b/libkcal/incidence.h @@ -114,2 +114,3 @@ class Incidence : public IncidenceBase virtual Incidence *clone() = 0; + virtual void cloneRelations( Incidence * ); |