summaryrefslogtreecommitdiffabout
path: root/libkcal/incidencebase.cpp
Unidiff
Diffstat (limited to 'libkcal/incidencebase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/incidencebase.cpp13
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
187QString IncidenceBase::dtStartTimeStr() const 187QString IncidenceBase::dtStartTimeStr() const
188{ 188{
189 return KGlobal::locale()->formatTime(dtStart().time()); 189 return KGlobal::locale()->formatTime(dtStart().time());
190} 190}
191 191
192QString IncidenceBase::dtStartDateStr(bool shortfmt) const 192QString 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
197QString IncidenceBase::dtStartStr(bool shortfmt) const 197QString 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
203bool IncidenceBase::doesFloat() const 203bool IncidenceBase::doesFloat() const
204{ 204{
205 return mFloats; 205 return mFloats;
206} 206}
207 207
208void IncidenceBase::setFloats(bool f) 208void 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
216void IncidenceBase::addAttendee(Attendee *a, bool doupdate) 216bool 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
227void IncidenceBase::removeAttendee(Attendee *a) 236void 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
234void IncidenceBase::removeAttendee(const char *n) 243void 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
247void IncidenceBase::clearAttendees() 256void 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
254Attendee *IncidenceBase::getAttendee(const char *n) const 263Attendee *IncidenceBase::getAttendee(const char *n) const
255{ 264{