summaryrefslogtreecommitdiffabout
path: root/libkcal/incidencebase.cpp
authorzautrix <zautrix>2004-11-08 08:05:08 (UTC)
committer zautrix <zautrix>2004-11-08 08:05:08 (UTC)
commit4481ce9842b3820087b24a8bfce2c194974aae73 (patch) (unidiff)
tree70da30be2b8cd4b6934c1a51c08a9d83aa93d8b6 /libkcal/incidencebase.cpp
parent90e33436f6d1c502a5620760ac6592b9881ee4ab (diff)
downloadkdepimpi-4481ce9842b3820087b24a8bfce2c194974aae73.zip
kdepimpi-4481ce9842b3820087b24a8bfce2c194974aae73.tar.gz
kdepimpi-4481ce9842b3820087b24a8bfce2c194974aae73.tar.bz2
some small fixes
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
@@ -192,56 +192,65 @@ QString IncidenceBase::dtStartTimeStr() const
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()