-rw-r--r-- | libkcal/incidencebase.cpp | 13 | ||||
-rw-r--r-- | libkcal/incidencebase.h | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp index 9aa517c..7525a4a 100644 --- a/libkcal/incidencebase.cpp +++ b/libkcal/incidencebase.cpp | |||
@@ -213,14 +213,23 @@ void IncidenceBase::setFloats(bool f) | |||
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 |
diff --git a/libkcal/incidencebase.h b/libkcal/incidencebase.h index e02d03a..f9a6558 100644 --- a/libkcal/incidencebase.h +++ b/libkcal/incidencebase.h | |||
@@ -100,7 +100,7 @@ class IncidenceBase : public CustomProperties | |||
100 | Add Attendee to this incidence. IncidenceBase takes ownership of the | 100 | Add Attendee to this incidence. IncidenceBase takes ownership of the |
101 | Attendee object. | 101 | Attendee object. |
102 | */ | 102 | */ |
103 | void addAttendee(Attendee *a, bool doupdate=true ); | 103 | bool addAttendee(Attendee *a, bool doupdate=true ); |
104 | // void removeAttendee(Attendee *a); | 104 | // void removeAttendee(Attendee *a); |
105 | // void removeAttendee(const char *n); | 105 | // void removeAttendee(const char *n); |
106 | /** Remove all Attendees. */ | 106 | /** Remove all Attendees. */ |