author | zautrix <zautrix> | 2005-07-09 10:40:57 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-09 10:40:57 (UTC) |
commit | b51db424f4b1e558ab8c7c723859bb564c99d83b (patch) (unidiff) | |
tree | 2de26e6455c6b07b17cb169ef23e4170387a5fcc /libkcal/incidencebase.cpp | |
parent | f731dd9fc5b3f14c44d4de26eb5370a79c63887c (diff) | |
download | kdepimpi-b51db424f4b1e558ab8c7c723859bb564c99d83b.zip kdepimpi-b51db424f4b1e558ab8c7c723859bb564c99d83b.tar.gz kdepimpi-b51db424f4b1e558ab8c7c723859bb564c99d83b.tar.bz2 |
fixxx
-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 | |||
@@ -21,51 +21,53 @@ | |||
21 | #include <kglobal.h> | 21 | #include <kglobal.h> |
22 | #include <klocale.h> | 22 | #include <klocale.h> |
23 | #include <kdebug.h> | 23 | #include <kdebug.h> |
24 | #include <kidmanager.h> | 24 | #include <kidmanager.h> |
25 | 25 | ||
26 | #include "calformat.h" | 26 | #include "calformat.h" |
27 | #include "syncdefines.h" | 27 | #include "syncdefines.h" |
28 | 28 | ||
29 | #include "incidencebase.h" | 29 | #include "incidencebase.h" |
30 | 30 | ||
31 | using namespace KCal; | 31 | using namespace KCal; |
32 | 32 | ||
33 | IncidenceBase::IncidenceBase() : | 33 | IncidenceBase::IncidenceBase() : |
34 | mReadOnly(false), mFloats(true), mDuration(0), mHasDuration(false), | 34 | mReadOnly(false), mFloats(true), mDuration(0), mHasDuration(false), |
35 | mPilotId(0), mSyncStatus(SYNCMOD) | 35 | mPilotId(0), mSyncStatus(SYNCMOD) |
36 | { | 36 | { |
37 | blockLastModified = false; | ||
37 | setUid(CalFormat::createUniqueId()); | 38 | setUid(CalFormat::createUniqueId()); |
38 | mOrganizer = ""; | 39 | mOrganizer = ""; |
39 | mFloats = false; | 40 | mFloats = false; |
40 | mDuration = 0; | 41 | mDuration = 0; |
41 | mHasDuration = false; | 42 | mHasDuration = false; |
42 | mPilotId = 0; | 43 | mPilotId = 0; |
43 | mExternalId = ":"; | 44 | mExternalId = ":"; |
44 | mTempSyncStat = SYNC_TEMPSTATE_INITIAL; | 45 | mTempSyncStat = SYNC_TEMPSTATE_INITIAL; |
45 | mSyncStatus = 0; | 46 | mSyncStatus = 0; |
46 | mAttendees.setAutoDelete( true ); | 47 | mAttendees.setAutoDelete( true ); |
47 | mCalEnabled = true; | 48 | mCalEnabled = true; |
48 | mAlarmEnabled = true; | 49 | mAlarmEnabled = true; |
49 | mCalID = 0; | 50 | mCalID = 0; |
50 | } | 51 | } |
51 | 52 | ||
52 | IncidenceBase::IncidenceBase(const IncidenceBase &i) : | 53 | IncidenceBase::IncidenceBase(const IncidenceBase &i) : |
53 | CustomProperties( i ) | 54 | CustomProperties( i ) |
54 | { | 55 | { |
55 | 56 | ||
57 | blockLastModified = false; | ||
56 | mReadOnly = i.mReadOnly; | 58 | mReadOnly = i.mReadOnly; |
57 | mDtStart = i.mDtStart; | 59 | mDtStart = i.mDtStart; |
58 | mDuration = i.mDuration; | 60 | mDuration = i.mDuration; |
59 | mHasDuration = i.mHasDuration; | 61 | mHasDuration = i.mHasDuration; |
60 | mOrganizer = i.mOrganizer; | 62 | mOrganizer = i.mOrganizer; |
61 | mUid = i.mUid; | 63 | mUid = i.mUid; |
62 | mCalEnabled = i.mCalEnabled; | 64 | mCalEnabled = i.mCalEnabled; |
63 | mAlarmEnabled = i.mAlarmEnabled; | 65 | mAlarmEnabled = i.mAlarmEnabled; |
64 | mCalID = i.mCalID; | 66 | mCalID = i.mCalID; |
65 | QPtrList<Attendee> attendees = i.attendees(); | 67 | QPtrList<Attendee> attendees = i.attendees(); |
66 | for( Attendee *a = attendees.first(); a; a = attendees.next() ) { | 68 | for( Attendee *a = attendees.first(); a; a = attendees.next() ) { |
67 | mAttendees.append( new Attendee( *a ) ); | 69 | mAttendees.append( new Attendee( *a ) ); |
68 | } | 70 | } |
69 | mFloats = i.mFloats; | 71 | mFloats = i.mFloats; |
70 | mLastModified = i.mLastModified; | 72 | mLastModified = i.mLastModified; |
71 | mPilotId = i.mPilotId; | 73 | mPilotId = i.mPilotId; |
@@ -136,34 +138,37 @@ QDateTime IncidenceBase::getEvenTime( QDateTime dt ) | |||
136 | { | 138 | { |
137 | QTime t = dt.time(); | 139 | QTime t = dt.time(); |
138 | dt.setTime( QTime (t.hour (), t.minute (), t.second () ) ); | 140 | dt.setTime( QTime (t.hour (), t.minute (), t.second () ) ); |
139 | return dt; | 141 | return dt; |
140 | } | 142 | } |
141 | 143 | ||
142 | bool IncidenceBase::isTagged() const | 144 | bool IncidenceBase::isTagged() const |
143 | { | 145 | { |
144 | return mIsTagged; | 146 | return mIsTagged; |
145 | } | 147 | } |
146 | void IncidenceBase::setTagged( bool b) | 148 | void IncidenceBase::setTagged( bool b) |
147 | { | 149 | { |
148 | mIsTagged = b; | 150 | mIsTagged = b; |
149 | } | 151 | } |
150 | void IncidenceBase::setCalID( int id ) | 152 | void IncidenceBase::setCalID( int id ) |
151 | { | 153 | { |
152 | if ( mCalID > 0 ) | 154 | if ( mCalID > 0 ) { |
155 | blockLastModified = true; | ||
153 | updated(); | 156 | updated(); |
157 | blockLastModified = false; | ||
158 | } | ||
154 | mCalID = id; | 159 | mCalID = id; |
155 | } | 160 | } |
156 | int IncidenceBase::calID() const | 161 | int IncidenceBase::calID() const |
157 | { | 162 | { |
158 | return mCalID; | 163 | return mCalID; |
159 | } | 164 | } |
160 | void IncidenceBase::setCalEnabled( bool b ) | 165 | void IncidenceBase::setCalEnabled( bool b ) |
161 | { | 166 | { |
162 | mCalEnabled = b; | 167 | mCalEnabled = b; |
163 | } | 168 | } |
164 | bool IncidenceBase::calEnabled() const | 169 | bool IncidenceBase::calEnabled() const |
165 | { | 170 | { |
166 | return mCalEnabled; | 171 | return mCalEnabled; |
167 | } | 172 | } |
168 | 173 | ||
169 | void IncidenceBase::setAlarmEnabled( bool b ) | 174 | void IncidenceBase::setAlarmEnabled( bool b ) |
@@ -176,32 +181,33 @@ bool IncidenceBase::alarmEnabled() const | |||
176 | } | 181 | } |
177 | 182 | ||
178 | 183 | ||
179 | void IncidenceBase::setUid(const QString &uid) | 184 | void IncidenceBase::setUid(const QString &uid) |
180 | { | 185 | { |
181 | mUid = uid; | 186 | mUid = uid; |
182 | updated(); | 187 | updated(); |
183 | } | 188 | } |
184 | 189 | ||
185 | QString IncidenceBase::uid() const | 190 | QString IncidenceBase::uid() const |
186 | { | 191 | { |
187 | return mUid; | 192 | return mUid; |
188 | } | 193 | } |
189 | 194 | ||
190 | void IncidenceBase::setLastModified(const QDateTime &lm) | 195 | void IncidenceBase::setLastModified(const QDateTime &lm) |
191 | { | 196 | { |
197 | if ( blockLastModified ) return; | ||
192 | // DON'T! updated() because we call this from | 198 | // DON'T! updated() because we call this from |
193 | // Calendar::updateEvent(). | 199 | // Calendar::updateEvent(). |
194 | mLastModified = getEvenTime(lm); | 200 | mLastModified = getEvenTime(lm); |
195 | //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1()); | 201 | //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1()); |
196 | } | 202 | } |
197 | 203 | ||
198 | QDateTime IncidenceBase::lastModified() const | 204 | QDateTime IncidenceBase::lastModified() const |
199 | { | 205 | { |
200 | return mLastModified; | 206 | return mLastModified; |
201 | } | 207 | } |
202 | 208 | ||
203 | void IncidenceBase::setOrganizer(const QString &o) | 209 | void IncidenceBase::setOrganizer(const QString &o) |
204 | { | 210 | { |
205 | // we don't check for readonly here, because it is | 211 | // we don't check for readonly here, because it is |
206 | // possible that by setting the organizer we are changing | 212 | // possible that by setting the organizer we are changing |
207 | // the event's readonly status... | 213 | // the event's readonly status... |