-rw-r--r-- | libkcal/incidencebase.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp index dcead02..1a19f3e 100644 --- a/libkcal/incidencebase.cpp +++ b/libkcal/incidencebase.cpp @@ -29,16 +29,17 @@ #include "incidencebase.h" using namespace KCal; IncidenceBase::IncidenceBase() : mReadOnly(false), mFloats(true), mDuration(0), mHasDuration(false), mPilotId(0), mSyncStatus(SYNCMOD) { + blockLastModified = false; setUid(CalFormat::createUniqueId()); mOrganizer = ""; mFloats = false; mDuration = 0; mHasDuration = false; mPilotId = 0; mExternalId = ":"; mTempSyncStat = SYNC_TEMPSTATE_INITIAL; @@ -48,16 +49,17 @@ IncidenceBase::IncidenceBase() : mAlarmEnabled = true; mCalID = 0; } IncidenceBase::IncidenceBase(const IncidenceBase &i) : CustomProperties( i ) { + blockLastModified = false; mReadOnly = i.mReadOnly; mDtStart = i.mDtStart; mDuration = i.mDuration; mHasDuration = i.mHasDuration; mOrganizer = i.mOrganizer; mUid = i.mUid; mCalEnabled = i.mCalEnabled; mAlarmEnabled = i.mAlarmEnabled; @@ -144,18 +146,21 @@ bool IncidenceBase::isTagged() const return mIsTagged; } void IncidenceBase::setTagged( bool b) { mIsTagged = b; } void IncidenceBase::setCalID( int id ) { - if ( mCalID > 0 ) + if ( mCalID > 0 ) { + blockLastModified = true; updated(); + blockLastModified = false; + } mCalID = id; } int IncidenceBase::calID() const { return mCalID; } void IncidenceBase::setCalEnabled( bool b ) { @@ -184,16 +189,17 @@ void IncidenceBase::setUid(const QString &uid) QString IncidenceBase::uid() const { return mUid; } void IncidenceBase::setLastModified(const QDateTime &lm) { + if ( blockLastModified ) return; // DON'T! updated() because we call this from // Calendar::updateEvent(). mLastModified = getEvenTime(lm); //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1()); } QDateTime IncidenceBase::lastModified() const { |