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/incidence.cpp | |
parent | 04fe8f3523c46511e846a42e4bb92d6b8d33758b (diff) | |
download | kdepimpi-ef11b9d4de01d601bfcfb8efacb0aeff1e657edb.zip kdepimpi-ef11b9d4de01d601bfcfb8efacb0aeff1e657edb.tar.gz kdepimpi-ef11b9d4de01d601bfcfb8efacb0aeff1e657edb.tar.bz2 |
fix
-rw-r--r-- | libkcal/incidence.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 6bca12c..78fa24f 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp @@ -242,49 +242,61 @@ Incidence* Incidence::recreateCloneException( QDate d ) newInc->setDtStart( QDateTime(d, tim) ); ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); } else { int len = dtStart().secsTo( ((Todo*)this)->dtDue()); QTime tim = ((Todo*)this)->dtDue().time(); ((Todo*)newInc)->setDtDue( QDateTime(d, tim) ); ((Todo*)newInc)->setDtStart( ((Todo*)newInc)->dtDue().addSecs( -len ) ); ((Todo*)this)->setRecurDates(); } newInc->setExDates( DateList () ); } return newInc; } void Incidence::recreate() { setCreated(QDateTime::currentDateTime()); setUid(CalFormat::createUniqueId()); setRevision(0); setIDStr( ":" ); setLastModified(QDateTime::currentDateTime()); } - +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 ) { IncidenceBase::setReadOnly( readOnly ); recurrence()->setRecurReadOnly( readOnly); } void Incidence::setCreated(QDateTime created) { if (mReadOnly) return; mCreated = getEvenTime(created); } QDateTime Incidence::created() const { return mCreated; } void Incidence::setRevision(int rev) { if (mReadOnly) return; mRevision = rev; updated(); } |