-rw-r--r-- | libkcal/incidencebase.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp index 9aa517c..7525a4a 100644 --- a/libkcal/incidencebase.cpp +++ b/libkcal/incidencebase.cpp | |||
@@ -184,72 +184,81 @@ QDateTime IncidenceBase::dtStart() const | |||
184 | return mDtStart; | 184 | return mDtStart; |
185 | } | 185 | } |
186 | 186 | ||
187 | QString IncidenceBase::dtStartTimeStr() const | 187 | QString IncidenceBase::dtStartTimeStr() const |
188 | { | 188 | { |
189 | return KGlobal::locale()->formatTime(dtStart().time()); | 189 | return KGlobal::locale()->formatTime(dtStart().time()); |
190 | } | 190 | } |
191 | 191 | ||
192 | QString IncidenceBase::dtStartDateStr(bool shortfmt) const | 192 | QString IncidenceBase::dtStartDateStr(bool shortfmt) const |
193 | { | 193 | { |
194 | return KGlobal::locale()->formatDate(dtStart().date(),shortfmt); | 194 | return KGlobal::locale()->formatDate(dtStart().date(),shortfmt); |
195 | } | 195 | } |
196 | 196 | ||
197 | QString IncidenceBase::dtStartStr(bool shortfmt) const | 197 | QString IncidenceBase::dtStartStr(bool shortfmt) const |
198 | { | 198 | { |
199 | return KGlobal::locale()->formatDateTime(dtStart(), shortfmt); | 199 | return KGlobal::locale()->formatDateTime(dtStart(), shortfmt); |
200 | } | 200 | } |
201 | 201 | ||
202 | 202 | ||
203 | bool IncidenceBase::doesFloat() const | 203 | bool IncidenceBase::doesFloat() const |
204 | { | 204 | { |
205 | return mFloats; | 205 | return mFloats; |
206 | } | 206 | } |
207 | 207 | ||
208 | void IncidenceBase::setFloats(bool f) | 208 | void IncidenceBase::setFloats(bool f) |
209 | { | 209 | { |
210 | if (mReadOnly) return; | 210 | if (mReadOnly) return; |
211 | mFloats = f; | 211 | mFloats = f; |
212 | updated(); | 212 | updated(); |
213 | } | 213 | } |
214 | 214 | ||
215 | 215 | ||
216 | void IncidenceBase::addAttendee(Attendee *a, bool doupdate) | 216 | bool IncidenceBase::addAttendee(Attendee *a, bool doupdate) |
217 | { | 217 | { |
218 | if (mReadOnly) return; | 218 | if (mReadOnly) return false; |
219 | if (a->name().left(7).upper() == "MAILTO:") | 219 | if (a->name().left(7).upper() == "MAILTO:") |
220 | a->setName(a->name().remove(0,7)); | 220 | a->setName(a->name().remove(0,7)); |
221 | 221 | ||
222 | QPtrListIterator<Attendee> qli(mAttendees); | ||
223 | |||
224 | qli.toFirst(); | ||
225 | while (qli) { | ||
226 | if (*qli.current() == *a) | ||
227 | return false; | ||
228 | ++qli; | ||
229 | } | ||
222 | mAttendees.append(a); | 230 | mAttendees.append(a); |
223 | if (doupdate) updated(); | 231 | if (doupdate) updated(); |
232 | return true; | ||
224 | } | 233 | } |
225 | 234 | ||
226 | #if 0 | 235 | #if 0 |
227 | void IncidenceBase::removeAttendee(Attendee *a) | 236 | void IncidenceBase::removeAttendee(Attendee *a) |
228 | { | 237 | { |
229 | if (mReadOnly) return; | 238 | if (mReadOnly) return; |
230 | mAttendees.removeRef(a); | 239 | mAttendees.removeRef(a); |
231 | updated(); | 240 | updated(); |
232 | } | 241 | } |
233 | 242 | ||
234 | void IncidenceBase::removeAttendee(const char *n) | 243 | void IncidenceBase::removeAttendee(const char *n) |
235 | { | 244 | { |
236 | Attendee *a; | 245 | Attendee *a; |
237 | 246 | ||
238 | if (mReadOnly) return; | 247 | if (mReadOnly) return; |
239 | for (a = mAttendees.first(); a; a = mAttendees.next()) | 248 | for (a = mAttendees.first(); a; a = mAttendees.next()) |
240 | if (a->getName() == n) { | 249 | if (a->getName() == n) { |
241 | mAttendees.remove(); | 250 | mAttendees.remove(); |
242 | break; | 251 | break; |
243 | } | 252 | } |
244 | } | 253 | } |
245 | #endif | 254 | #endif |
246 | 255 | ||
247 | void IncidenceBase::clearAttendees() | 256 | void IncidenceBase::clearAttendees() |
248 | { | 257 | { |
249 | if (mReadOnly) return; | 258 | if (mReadOnly) return; |
250 | mAttendees.clear(); | 259 | mAttendees.clear(); |
251 | } | 260 | } |
252 | 261 | ||
253 | #if 0 | 262 | #if 0 |
254 | Attendee *IncidenceBase::getAttendee(const char *n) const | 263 | Attendee *IncidenceBase::getAttendee(const char *n) const |
255 | { | 264 | { |