summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/kaddressbook/germantranslation.txt4
-rw-r--r--korganizer/koeditordetails.cpp8
-rw-r--r--libkcal/incidencebase.cpp13
-rw-r--r--libkcal/incidencebase.h2
4 files changed, 21 insertions, 6 deletions
diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt
index 75df50f..85ca87d 100644
--- a/bin/kdepim/kaddressbook/germantranslation.txt
+++ b/bin/kdepim/kaddressbook/germantranslation.txt
@@ -288,153 +288,153 @@
288{ "Additional Names","Mittelname" }, 288{ "Additional Names","Mittelname" },
289{ "Honorific Prefixes","Namen Prefix" }, 289{ "Honorific Prefixes","Namen Prefix" },
290{ "Honorific Suffixes","Namen Suffix" }, 290{ "Honorific Suffixes","Namen Suffix" },
291{ "Nick Name","Sptitzname" }, 291{ "Nick Name","Sptitzname" },
292{ "Birthday","Geburtstag" }, 292{ "Birthday","Geburtstag" },
293{ "Home Address Street","Privat Adresse Strasse" }, 293{ "Home Address Street","Privat Adresse Strasse" },
294{ "Home Address Locality","Privat Adresse Stadt" }, 294{ "Home Address Locality","Privat Adresse Stadt" },
295{ "Home Address Region","Privat Adresse Bundesland" }, 295{ "Home Address Region","Privat Adresse Bundesland" },
296{ "Home Address Postal Code","Privat Adresse PLZ" }, 296{ "Home Address Postal Code","Privat Adresse PLZ" },
297{ "Home Address Country","Privat Adresse Land" }, 297{ "Home Address Country","Privat Adresse Land" },
298{ "Home Address Label","Privat Adresse Label" }, 298{ "Home Address Label","Privat Adresse Label" },
299{ "Business Address Street","Büro Adresse Strasse" }, 299{ "Business Address Street","Büro Adresse Strasse" },
300{ "Business Address Locality","Büro Adresse Stadt" }, 300{ "Business Address Locality","Büro Adresse Stadt" },
301{ "Business Address Region","Büro Adresse Bundesland" }, 301{ "Business Address Region","Büro Adresse Bundesland" },
302{ "Business Address Postal Code","Büro Adresse PLZ" }, 302{ "Business Address Postal Code","Büro Adresse PLZ" },
303{ "Business Address Country","Büro Adresse Land" }, 303{ "Business Address Country","Büro Adresse Land" },
304{ "Business Address Label","Büro Adresse Label" }, 304{ "Business Address Label","Büro Adresse Label" },
305{ "Home Phone","Privat Telefon" }, 305{ "Home Phone","Privat Telefon" },
306{ "Business Phone","Büro Telefon" }, 306{ "Business Phone","Büro Telefon" },
307{ "Mobile Phone","Handy" }, 307{ "Mobile Phone","Handy" },
308{ "Home Fax","Privat Fax" }, 308{ "Home Fax","Privat Fax" },
309{ "Business Fax","Büro Fax" }, 309{ "Business Fax","Büro Fax" },
310{ "Car Phone","Autotelefon" }, 310{ "Car Phone","Autotelefon" },
311{ "ISDN","ISDN" }, 311{ "ISDN","ISDN" },
312{ "Pager","Pager" }, 312{ "Pager","Pager" },
313{ "Mail Client","Mail Client" }, 313{ "Mail Client","Mail Client" },
314{ "Title","Titel" }, 314{ "Title","Titel" },
315{ "Role","Rolle" }, 315{ "Role","Rolle" },
316{ "Note","Notiz" }, 316{ "Note","Notiz" },
317{ "URL","URL" }, 317{ "URL","URL" },
318{ "Resource","Resource" }, 318{ "Resource","Resource" },
319{ "SIP","SIP" }, 319{ "SIP","SIP" },
320{ "Default Filter","Default Filter" }, 320{ "Default Filter","Default Filter" },
321{ "The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime.","#The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime." }, 321{ "The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime.","#The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime." },
322{ "No default filter","Kein default Filter" }, 322{ "No default filter","Kein default Filter" },
323{ "Use last active filter","Nutze letzen aktiven Filter" }, 323{ "Use last active filter","Nutze letzen aktiven Filter" },
324{ "Use filter:","Nutze Filter:" }, 324{ "Use filter:","Nutze Filter:" },
325{ "Look & Feel","Look & Feel" }, 325{ "Look & Feel","Look & Feel" },
326{ "Row Separator","Reihen Separator" }, 326{ "Row Separator","Reihen Separator" },
327{ "Alternating backgrounds","Abwechselnder Hintergrund" }, 327{ "Alternating backgrounds","Abwechselnder Hintergrund" },
328{ "Single line","Einzelne Zeile" }, 328{ "Single line","Einzelne Zeile" },
329{ "Enable background image:","Hintergrundbild:" }, 329{ "Enable background image:","Hintergrundbild:" },
330{ "Enable contact tooltips","Contact Tooltips" }, 330{ "Enable contact tooltips","Contact Tooltips" },
331{ "&Enable custom Colors","Benutzerdef. Farben" }, 331{ "&Enable custom Colors","Benutzerdef. Farben" },
332{ "&Colors","Farben" }, 332{ "&Colors","Farben" },
333{ "If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used.","#If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used." }, 333{ "If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used.","#If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used." },
334{ "Double click or press RETURN on a item to select a color for the related strings in the view.","#Double click or press RETURN on a item to select a color for the related strings in the view." }, 334{ "Double click or press RETURN on a item to select a color for the related strings in the view.","#Double click or press RETURN on a item to select a color for the related strings in the view." },
335{ "&Enable custom fonts","B&enutzerdefinierte Schriften" }, 335{ "&Enable custom fonts","B&enutzerdefinierte Schriften" },
336{ "&Text font:","Textschriftart:" }, 336{ "&Text font:","Textschriftart:" },
337{ "&Header font:","Titelschriftart:" }, 337{ "&Header font:","Titelschriftart:" },
338{ "If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data.","#If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data." }, 338{ "If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data.","#If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data." },
339{ "&Fonts","Schri&ften" }, 339{ "&Fonts","Schri&ften" },
340{ "Background Color","Hintergrundfarbe" }, 340{ "Background Color","Hintergrundfarbe" },
341{ "Text Color","Textfarbe" }, 341{ "Text Color","Textfarbe" },
342{ "Header Background Color","Titel Hintergrundfarbe" }, 342{ "Header Background Color","Titel Hintergrundfarbe" },
343{ "Header Text Color","Titel Farbe" }, 343{ "Header Text Color","Titel Farbe" },
344{ "Highlight Color","Auswahlfarbe" }, 344{ "Highlight Color","Auswahlfarbe" },
345{ "Highlighted Text Color","Auswahltextfarbe" }, 345{ "Highlighted Text Color","Auswahltextfarbe" },
346{ "Alternating Background Color","Abwechselnder Hintergrundfarbe" }, 346{ "Alternating Background Color","Abwechselnder Hintergrundfarbe" },
347{ "Postal","Post" }, 347{ "Postal","Post" },
348{ "Dr.","Dr." }, 348{ "Dr.","Dr." },
349{ "Miss","Frl." }, 349{ "Miss","Frl." },
350{ "Mr.","Herr" }, 350{ "Mr.","Herr" },
351{ "Mrs.","Frau" }, 351{ "Mrs.","Frau" },
352{ "Ms.","Frau" }, 352{ "Ms.","Fr." },
353{ "Prof.","Prof." }, 353{ "Prof.","Prof." },
354{ "I","I" }, 354{ "I","I" },
355{ "II","II" }, 355{ "II","II" },
356{ "III","III" }, 356{ "III","III" },
357{ "Jr.","Jr." }, 357{ "Jr.","Jr." },
358{ "Sr.","Sr." }, 358{ "Sr.","Sr." },
359{ "Name:","Name:" }, 359{ "Name:","Name:" },
360{ "Documents","Dokumente" }, 360{ "Documents","Dokumente" },
361{ "Files","Dateien" }, 361{ "Files","Dateien" },
362{ "All Files","Alle Dateien" }, 362{ "All Files","Alle Dateien" },
363{ "Name","Name" }, 363{ "Name","Name" },
364{ "Size","Größe" }, 364{ "Size","Größe" },
365{ "Date","Datum" }, 365{ "Date","Datum" },
366{ "Mime Type","Mime Typ" }, 366{ "Mime Type","Mime Typ" },
367{ "Geo Data Input","Geo Dateneingabe" }, 367{ "Geo Data Input","Geo Dateneingabe" },
368{ "Sexagesimal","Sexagesimal" }, 368{ "Sexagesimal","Sexagesimal" },
369{ "North","Nord" }, 369{ "North","Nord" },
370{ "South","Süd" }, 370{ "South","Süd" },
371{ "East","Ost" }, 371{ "East","Ost" },
372{ "West","West" }, 372{ "West","West" },
373{ "Undefined","Unbestimmt" }, 373{ "Undefined","Unbestimmt" },
374{ "Edit Address","Bearbeite Adresse" }, 374{ "Edit Address","Bearbeite Adresse" },
375{ "Street:","Strasse:" }, 375{ "Street:","Strasse:" },
376{ "Post office box:","PLZ:" }, 376{ "Post office box:","Postfach:" },
377{ "Locality:","Stadt:" }, 377{ "Locality:","Stadt:" },
378{ "Region:","Region:" }, 378{ "Region:","Region:" },
379{ "Postal code:","PLZ:" }, 379{ "Postal code:","PLZ:" },
380{ "Country:","Staat:" }, 380{ "Country:","Staat:" },
381{ "This is the preferred address","Dies ist die bevorzugte Adresse" }, 381{ "This is the preferred address","Dies ist die bevorzugte Adresse" },
382{ "New...","Neu..." }, 382{ "New...","Neu..." },
383{ "Change Type","Ändere Art" }, 383{ "Change Type","Ändere Art" },
384{ "Edit Address Type","Ändere Address Art" }, 384{ "Edit Address Type","Ändere Address Art" },
385{ "Address Types","Address Art" }, 385{ "Address Types","Address Art" },
386{ "Domestic","Inland" }, 386{ "Domestic","Inland" },
387{ "International","International" }, 387{ "International","International" },
388{ "Parcel","Paket" }, 388{ "Parcel","Paket" },
389{ "Edit Contact Name","Ändere Kontakt Name" }, 389{ "Edit Contact Name","Ändere Kontakt Name" },
390{ "Honorific prefixes:","Namensprefixes:" }, 390{ "Honorific prefixes:","Namensprefixes:" },
391{ "Given name:","Vorname:" }, 391{ "Given name:","Vorname:" },
392{ "Additional names:","Mittelnamen:" }, 392{ "Additional names:","Mittelnamen:" },
393{ "Family names:","Nachname:" }, 393{ "Family names:","Nachname:" },
394{ "Honorific suffixes:","Namenssuffixe:" }, 394{ "Honorific suffixes:","Namenssuffixe:" },
395{ "Parse name automatically","Setze Namen automatisch" }, 395{ "Parse name automatically","Setze Namen automatisch" },
396{ "Edit Phone Numbers","Bearbeite Telefonnummern" }, 396{ "Edit Phone Numbers","Bearbeite Telefonnummern" },
397{ "Number","Nummer" }, 397{ "Number","Nummer" },
398{ "Type","Typ" }, 398{ "Type","Typ" },
399{ "Edit Phone Number","Bearbeite Telefonnummer" }, 399{ "Edit Phone Number","Bearbeite Telefonnummer" },
400{ "Number:","Nummer:" }, 400{ "Number:","Nummer:" },
401{ "This is the preferred phone number","Dies ist die bevorzugte Telefonnummer" }, 401{ "This is the preferred phone number","Dies ist die bevorzugte Telefonnummer" },
402{ "Types","Typen" }, 402{ "Types","Typen" },
403{ "Messenger","Messenger" }, 403{ "Messenger","Messenger" },
404{ "Other","Anderes" }, 404{ "Other","Anderes" },
405{ "Video","Video" }, 405{ "Video","Video" },
406{ "Mailbox","Mailbox" }, 406{ "Mailbox","Mailbox" },
407{ "Modem","Modem" }, 407{ "Modem","Modem" },
408{ "Car","Auto" }, 408{ "Car","Auto" },
409{ "PCS","PCS" }, 409{ "PCS","PCS" },
410{ "Category","Kategorie" }, 410{ "Category","Kategorie" },
411{ "Select Categories","Wähle Kategorien" }, 411{ "Select Categories","Wähle Kategorien" },
412{ " &Deselect All "," &Deselektiere alle " }, 412{ " &Deselect All "," &Deselektiere alle " },
413{ " &Edit Categories "," B&earbeite Kategorien " }, 413{ " &Edit Categories "," B&earbeite Kategorien " },
414{ "&OK","&OK" }, 414{ "&OK","&OK" },
415{ "&Cancel","Abbre&chen" }, 415{ "&Cancel","Abbre&chen" },
416{ "Configure","Konfiguriere" }, 416{ "Configure","Konfiguriere" },
417{ "Default","Voreinstellungen" }, 417{ "Default","Voreinstellungen" },
418{ "Addressbook","Adressbuch" }, 418{ "Addressbook","Adressbuch" },
419{ "Details view font","Schriftart Detailansicht" }, 419{ "Details view font","Schriftart Detailansicht" },
420{ "phone:123","phone:123" }, 420{ "phone:123","phone:123" },
421{ "Search only after <return> key pressed","Suche nur nach <return> Taste" }, 421{ "Search only after <return> key pressed","Suche nur nach <return> Taste" },
422{ "Honor KDE single click","Benutze KDE Einzelklick" }, 422{ "Honor KDE single click","Benutze KDE Einzelklick" },
423{ "Automatic name parsing for new addressees","Automa. Name Parsen für neue Einträge" }, 423{ "Automatic name parsing for new addressees","Automa. Name Parsen für neue Einträge" },
424{ "Display List and Details at once (restart)","Zeige Liste und Details zusammen(neustart)" }, 424{ "Display List and Details at once (restart)","Zeige Liste und Details zusammen(neustart)" },
425{ "Ask for quit when closing Ka/Pi","Vor Beenden von Ka/Pi nachfragen" }, 425{ "Ask for quit when closing Ka/Pi","Vor Beenden von Ka/Pi nachfragen" },
426{ "General","Algemein" }, 426{ "General","Algemein" },
427{ "Extensions (restart)","Extensions (restart)" }, 427{ "Extensions (restart)","Extensions (restart)" },
428{ "Description","Beschreibungen" }, 428{ "Description","Beschreibungen" },
429{ "Extensions","Extensions" }, 429{ "Extensions","Extensions" },
430{ "Prefixes","Prefixe" }, 430{ "Prefixes","Prefixe" },
431{ "Inclusions","Inclusions" }, 431{ "Inclusions","Inclusions" },
432{ "Suffixes","Suffixe" }, 432{ "Suffixes","Suffixe" },
433{ "Default formatted name:","Default format. Name:" }, 433{ "Default formatted name:","Default format. Name:" },
434{ "Empty","Leer" }, 434{ "Empty","Leer" },
435{ "Simple Name","Einfacher Name" }, 435{ "Simple Name","Einfacher Name" },
436{ "Full Name","Voller Name" }, 436{ "Full Name","Voller Name" },
437{ "Reverse Name","Namen umdrehen" }, 437{ "Reverse Name","Namen umdrehen" },
438{ "Contact","Kontakt" }, 438{ "Contact","Kontakt" },
439{ "Global","Allgemein" }, 439{ "Global","Allgemein" },
440{ "Phone","Telefon" }, 440{ "Phone","Telefon" },
diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp
index 2e1ae6e..66f6977 100644
--- a/korganizer/koeditordetails.cpp
+++ b/korganizer/koeditordetails.cpp
@@ -238,131 +238,137 @@ void KOEditorDetails::openAddressBook()
238 uint i=0; 238 uint i=0;
239 for (i=0; i < list.count(); i++) { 239 for (i=0; i < list.count(); i++) {
240 insertAttendee( new Attendee( list[i].realName(), list[i].preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,list[i].uid()) ); 240 insertAttendee( new Attendee( list[i].realName(), list[i].preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,list[i].uid()) );
241 } 241 }
242#else 242#else
243 bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 243 bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
244 // the result should now arrive through method insertAttendees 244 // the result should now arrive through method insertAttendees
245#endif 245#endif
246 246
247 247
248#if 0 248#if 0
249 KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this); 249 KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this);
250 if (!a.isEmpty()) { 250 if (!a.isEmpty()) {
251 insertAttendee( new Attendee( a.realName(), a.preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,a.uid()) ); 251 insertAttendee( new Attendee( a.realName(), a.preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,a.uid()) );
252 } 252 }
253#endif 253#endif
254#endif 254#endif
255} 255}
256 256
257 257
258void KOEditorDetails::addNewAttendee() 258void KOEditorDetails::addNewAttendee()
259{ 259{
260#if 0 260#if 0
261 // this is cool. If they didn't enter an email address, 261 // this is cool. If they didn't enter an email address,
262 // try to look it up in the address book and fill it in for them. 262 // try to look it up in the address book and fill it in for them.
263 if (QString(mEmailEdit->text()).stripWhiteSpace().isEmpty()) { 263 if (QString(mEmailEdit->text()).stripWhiteSpace().isEmpty()) {
264 KabAPI addrBook; 264 KabAPI addrBook;
265 QString name; 265 QString name;
266 std::list<AddressBook::Entry> entries; 266 std::list<AddressBook::Entry> entries;
267 name = mNameEdit->text(); 267 name = mNameEdit->text();
268 if (addrBook.init() == AddressBook::NoError) { 268 if (addrBook.init() == AddressBook::NoError) {
269 if (addrBook.getEntryByName(name, entries, 1) == AddressBook::NoError) { 269 if (addrBook.getEntryByName(name, entries, 1) == AddressBook::NoError) {
270 kdDebug() << "positive match" << endl; 270 kdDebug() << "positive match" << endl;
271 // take first email address 271 // take first email address
272 if (!entries.front().emails.isEmpty() && 272 if (!entries.front().emails.isEmpty() &&
273 entries.front().emails.first().length()>0) 273 entries.front().emails.first().length()>0)
274 mEmailEdit->setText(entries.front().emails.first()); 274 mEmailEdit->setText(entries.front().emails.first());
275 } 275 }
276 } 276 }
277 } 277 }
278#endif 278#endif
279 279
280 Attendee *a = new Attendee(i18n("(EmptyName)"),i18n("(EmptyEmail)")); 280 Attendee *a = new Attendee(i18n("(EmptyName)"),i18n("(EmptyEmail)"));
281 insertAttendee(a); 281 insertAttendee(a);
282} 282}
283 283
284//the map includes name/email pairs, that comes from Ka/Pi 284//the map includes name/email pairs, that comes from Ka/Pi
285void KOEditorDetails::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) 285void KOEditorDetails::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList)
286{ 286{
287 if (uid == this->name()) 287 if (uid == this->name())
288 { 288 {
289 for ( int i = 0; i < nameList.count(); i++) 289 for ( int i = 0; i < nameList.count(); i++)
290 { 290 {
291 QString _name = nameList[i]; 291 QString _name = nameList[i];
292 QString _email = emailList[i]; 292 QString _email = emailList[i];
293 QString _uid = uidList[i]; 293 QString _uid = uidList[i];
294 294
295 Attendee *a = new Attendee(_name,_email,false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant, _uid); 295 Attendee *a = new Attendee(_name,_email,false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant, _uid);
296 insertAttendee(a); 296 insertAttendee(a);
297 } 297 }
298 } 298 }
299 299
300} 300}
301 301
302
303void KOEditorDetails::insertAttendee(Attendee *a) 302void KOEditorDetails::insertAttendee(Attendee *a)
304{ 303{
304 AttendeeListItem *first = (AttendeeListItem*) mListView->firstChild();
305 while (first) {
306 if ( first->data()->name() == a->name() && first->data()->email() == a->email() )
307 return;
308 first = (AttendeeListItem*) first->nextSibling();
309 }
310
305 AttendeeListItem *item = new AttendeeListItem(a,mListView); 311 AttendeeListItem *item = new AttendeeListItem(a,mListView);
306 mListView->setSelected( item, true ); 312 mListView->setSelected( item, true );
307} 313}
308 314
309void KOEditorDetails::setDefaults() 315void KOEditorDetails::setDefaults()
310{ 316{
311 mRsvpButton->setChecked(true); 317 mRsvpButton->setChecked(true);
312 mListView->clear(); 318 mListView->clear();
313 mdelAttendees.clear(); 319 mdelAttendees.clear();
314 clearAttendeeInput(); 320 clearAttendeeInput();
315 mOrganizerLabel->setText(i18n("Organizer: %1").arg(KOPrefs::instance()->email())); 321 mOrganizerLabel->setText(i18n("Organizer: %1").arg(KOPrefs::instance()->email()));
316 322
317 mNameEdit->setText(""); 323 mNameEdit->setText("");
318 mUidEdit->setText(""); 324 mUidEdit->setText("");
319 mEmailEdit->setText(""); 325 mEmailEdit->setText("");
320 mRoleCombo->setCurrentItem( 0 ); 326 mRoleCombo->setCurrentItem( 0 );
321 mStatusCombo->setCurrentItem( 0 ); 327 mStatusCombo->setCurrentItem( 0 );
322 328
323} 329}
324 330
325void KOEditorDetails::readEvent(Incidence *event) 331void KOEditorDetails::readEvent(Incidence *event)
326{ 332{
327 setDefaults(); 333 setDefaults();
328 //mListView->clear(); 334 //mListView->clear();
329 //mdelAttendees.clear(); 335 //mdelAttendees.clear();
330 QPtrList<Attendee> tmpAList = event->attendees(); 336 QPtrList<Attendee> tmpAList = event->attendees();
331 Attendee *a; 337 Attendee *a;
332 for (a = tmpAList.first(); a; a = tmpAList.next()) 338 for (a = tmpAList.first(); a; a = tmpAList.next())
333 insertAttendee(new Attendee(*a)); 339 insertAttendee(new Attendee(*a));
334 340
335 mListView->setSelected( mListView->firstChild(), true ); 341 mListView->setSelected( mListView->firstChild(), true );
336 mOrganizerLabel->setText(i18n("Organizer: %1").arg(event->organizer())); 342 mOrganizerLabel->setText(i18n("Organizer: %1").arg(event->organizer()));
337} 343}
338 344
339void KOEditorDetails::writeEvent(Incidence *event) 345void KOEditorDetails::writeEvent(Incidence *event)
340{ 346{
341 event->clearAttendees(); 347 event->clearAttendees();
342 QListViewItem *item; 348 QListViewItem *item;
343 AttendeeListItem *a; 349 AttendeeListItem *a;
344 for (item = mListView->firstChild(); item; 350 for (item = mListView->firstChild(); item;
345 item = item->nextSibling()) { 351 item = item->nextSibling()) {
346 a = (AttendeeListItem *)item; 352 a = (AttendeeListItem *)item;
347 event->addAttendee(new Attendee(*(a->data()))); 353 event->addAttendee(new Attendee(*(a->data())));
348 } 354 }
349 event->setOrganizer(KOPrefs::instance()->email()); 355 event->setOrganizer(KOPrefs::instance()->email());
350} 356}
351 357
352void KOEditorDetails::cancelAttendeeEvent(Incidence *event) 358void KOEditorDetails::cancelAttendeeEvent(Incidence *event)
353{ 359{
354 event->clearAttendees(); 360 event->clearAttendees();
355 Attendee * att; 361 Attendee * att;
356 for (att=mdelAttendees.first();att;att=mdelAttendees.next()) { 362 for (att=mdelAttendees.first();att;att=mdelAttendees.next()) {
357 event->addAttendee(new Attendee(*att)); 363 event->addAttendee(new Attendee(*att));
358 } 364 }
359 mdelAttendees.clear(); 365 mdelAttendees.clear();
360} 366}
361 367
362bool KOEditorDetails::validateInput() 368bool KOEditorDetails::validateInput()
363{ 369{
364 return true; 370 return true;
365} 371}
366 372
367void KOEditorDetails::updateAttendeeInput() 373void KOEditorDetails::updateAttendeeInput()
368{ 374{
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp
index 9aa517c..7525a4a 100644
--- a/libkcal/incidencebase.cpp
+++ b/libkcal/incidencebase.cpp
@@ -152,136 +152,145 @@ QDateTime IncidenceBase::lastModified() const
152 152
153void IncidenceBase::setOrganizer(const QString &o) 153void IncidenceBase::setOrganizer(const QString &o)
154{ 154{
155 // we don't check for readonly here, because it is 155 // we don't check for readonly here, because it is
156 // possible that by setting the organizer we are changing 156 // possible that by setting the organizer we are changing
157 // the event's readonly status... 157 // the event's readonly status...
158 mOrganizer = o; 158 mOrganizer = o;
159 if (mOrganizer.left(7).upper() == "MAILTO:") 159 if (mOrganizer.left(7).upper() == "MAILTO:")
160 mOrganizer = mOrganizer.remove(0,7); 160 mOrganizer = mOrganizer.remove(0,7);
161 161
162 updated(); 162 updated();
163} 163}
164 164
165QString IncidenceBase::organizer() const 165QString IncidenceBase::organizer() const
166{ 166{
167 return mOrganizer; 167 return mOrganizer;
168} 168}
169 169
170void IncidenceBase::setReadOnly( bool readOnly ) 170void IncidenceBase::setReadOnly( bool readOnly )
171{ 171{
172 mReadOnly = readOnly; 172 mReadOnly = readOnly;
173} 173}
174 174
175void IncidenceBase::setDtStart(const QDateTime &dtStart) 175void IncidenceBase::setDtStart(const QDateTime &dtStart)
176{ 176{
177// if (mReadOnly) return; 177// if (mReadOnly) return;
178 mDtStart = getEvenTime(dtStart); 178 mDtStart = getEvenTime(dtStart);
179 updated(); 179 updated();
180} 180}
181 181
182QDateTime IncidenceBase::dtStart() const 182QDateTime IncidenceBase::dtStart() const
183{ 183{
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{
256 QPtrListIterator<Attendee> qli(mAttendees); 265 QPtrListIterator<Attendee> qli(mAttendees);
257 266
258 qli.toFirst(); 267 qli.toFirst();
259 while (qli) { 268 while (qli) {
260 if (qli.current()->getName() == n) 269 if (qli.current()->getName() == n)
261 return qli.current(); 270 return qli.current();
262 ++qli; 271 ++qli;
263 } 272 }
264 return 0L; 273 return 0L;
265} 274}
266#endif 275#endif
267 276
268Attendee *IncidenceBase::attendeeByMail(const QString &email) 277Attendee *IncidenceBase::attendeeByMail(const QString &email)
269{ 278{
270 QPtrListIterator<Attendee> qli(mAttendees); 279 QPtrListIterator<Attendee> qli(mAttendees);
271 280
272 qli.toFirst(); 281 qli.toFirst();
273 while (qli) { 282 while (qli) {
274 if (qli.current()->email().lower() == email.lower()) 283 if (qli.current()->email().lower() == email.lower())
275 return qli.current(); 284 return qli.current();
276 ++qli; 285 ++qli;
277 } 286 }
278 return 0L; 287 return 0L;
279} 288}
280 289
281Attendee *IncidenceBase::attendeeByMails(const QStringList &emails, const QString& email) 290Attendee *IncidenceBase::attendeeByMails(const QStringList &emails, const QString& email)
282{ 291{
283 QPtrListIterator<Attendee> qli(mAttendees); 292 QPtrListIterator<Attendee> qli(mAttendees);
284 293
285 QStringList mails = emails; 294 QStringList mails = emails;
286 if (!email.isEmpty()) { 295 if (!email.isEmpty()) {
287 mails.append(email); 296 mails.append(email);
diff --git a/libkcal/incidencebase.h b/libkcal/incidencebase.h
index e02d03a..f9a6558 100644
--- a/libkcal/incidencebase.h
+++ b/libkcal/incidencebase.h
@@ -39,129 +39,129 @@ typedef QValueList<QDate> DateList;
39 This class provides the base class common to all calendar components. 39 This class provides the base class common to all calendar components.
40*/ 40*/
41class IncidenceBase : public CustomProperties 41class IncidenceBase : public CustomProperties
42{ 42{
43 public: 43 public:
44 class Observer { 44 class Observer {
45 public: 45 public:
46 virtual void incidenceUpdated( IncidenceBase * ) = 0; 46 virtual void incidenceUpdated( IncidenceBase * ) = 0;
47 }; 47 };
48 48
49 IncidenceBase(); 49 IncidenceBase();
50 IncidenceBase(const IncidenceBase &); 50 IncidenceBase(const IncidenceBase &);
51 virtual ~IncidenceBase(); 51 virtual ~IncidenceBase();
52 52
53 virtual QCString type() const = 0; 53 virtual QCString type() const = 0;
54 54
55 /** Set the unique id for the event */ 55 /** Set the unique id for the event */
56 void setUid(const QString &); 56 void setUid(const QString &);
57 /** Return the unique id for the event */ 57 /** Return the unique id for the event */
58 QString uid() const; 58 QString uid() const;
59 59
60 /** Sets the time the incidence was last modified. */ 60 /** Sets the time the incidence was last modified. */
61 void setLastModified(const QDateTime &lm); 61 void setLastModified(const QDateTime &lm);
62 /** Return the time the incidence was last modified. */ 62 /** Return the time the incidence was last modified. */
63 QDateTime lastModified() const; 63 QDateTime lastModified() const;
64 64
65 /** sets the organizer for the event */ 65 /** sets the organizer for the event */
66 void setOrganizer(const QString &o); 66 void setOrganizer(const QString &o);
67 QString organizer() const; 67 QString organizer() const;
68 68
69 /** Set readonly status. */ 69 /** Set readonly status. */
70 virtual void setReadOnly( bool ); 70 virtual void setReadOnly( bool );
71 /** Return if the object is read-only. */ 71 /** Return if the object is read-only. */
72 bool isReadOnly() const { return mReadOnly; } 72 bool isReadOnly() const { return mReadOnly; }
73 73
74 /** for setting the event's starting date/time with a QDateTime. */ 74 /** for setting the event's starting date/time with a QDateTime. */
75 virtual void setDtStart(const QDateTime &dtStart); 75 virtual void setDtStart(const QDateTime &dtStart);
76 /** returns an event's starting date/time as a QDateTime. */ 76 /** returns an event's starting date/time as a QDateTime. */
77 QDateTime dtStart() const; 77 QDateTime dtStart() const;
78 /** returns an event's starting time as a string formatted according to the 78 /** returns an event's starting time as a string formatted according to the
79 users locale settings */ 79 users locale settings */
80 QString dtStartTimeStr() const; 80 QString dtStartTimeStr() const;
81 /** returns an event's starting date as a string formatted according to the 81 /** returns an event's starting date as a string formatted according to the
82 users locale settings */ 82 users locale settings */
83 QString dtStartDateStr(bool shortfmt=true) const; 83 QString dtStartDateStr(bool shortfmt=true) const;
84 /** returns an event's starting date and time as a string formatted according 84 /** returns an event's starting date and time as a string formatted according
85 to the users locale settings */ 85 to the users locale settings */
86 QString dtStartStr(bool shortfmt=true) const; 86 QString dtStartStr(bool shortfmt=true) const;
87 87
88 virtual void setDuration(int seconds); 88 virtual void setDuration(int seconds);
89 int duration() const; 89 int duration() const;
90 void setHasDuration(bool); 90 void setHasDuration(bool);
91 bool hasDuration() const; 91 bool hasDuration() const;
92 92
93 /** Return true or false depending on whether the incidence "floats," 93 /** Return true or false depending on whether the incidence "floats,"
94 * i.e. has a date but no time attached to it. */ 94 * i.e. has a date but no time attached to it. */
95 bool doesFloat() const; 95 bool doesFloat() const;
96 /** Set whether the incidence floats, i.e. has a date but no time attached to it. */ 96 /** Set whether the incidence floats, i.e. has a date but no time attached to it. */
97 void setFloats(bool f); 97 void setFloats(bool f);
98 98
99 /** 99 /**
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. */
107 void clearAttendees(); 107 void clearAttendees();
108 /** Return list of attendees. */ 108 /** Return list of attendees. */
109 QPtrList<Attendee> attendees() const { return mAttendees; }; 109 QPtrList<Attendee> attendees() const { return mAttendees; };
110 /** Return number of attendees. */ 110 /** Return number of attendees. */
111 int attendeeCount() const { return mAttendees.count(); }; 111 int attendeeCount() const { return mAttendees.count(); };
112 /** Return the Attendee with this email */ 112 /** Return the Attendee with this email */
113 Attendee* attendeeByMail(const QString &); 113 Attendee* attendeeByMail(const QString &);
114 /** Return first Attendee with one of this emails */ 114 /** Return first Attendee with one of this emails */
115 Attendee* attendeeByMails(const QStringList &, const QString& email = QString::null); 115 Attendee* attendeeByMails(const QStringList &, const QString& email = QString::null);
116 116
117 /** pilot syncronization states */ 117 /** pilot syncronization states */
118 enum { SYNCNONE = 0, SYNCMOD = 1, SYNCDEL = 3 }; 118 enum { SYNCNONE = 0, SYNCMOD = 1, SYNCDEL = 3 };
119 /** Set synchronisation satus. */ 119 /** Set synchronisation satus. */
120 void setSyncStatus(int stat); 120 void setSyncStatus(int stat);
121 /** Return synchronisation status. */ 121 /** Return synchronisation status. */
122 int syncStatus() const; 122 int syncStatus() const;
123 123
124 /** Set Pilot Id. */ 124 /** Set Pilot Id. */
125 void setPilotId(int id); 125 void setPilotId(int id);
126 /** Return Pilot Id. */ 126 /** Return Pilot Id. */
127 int pilotId() const; 127 int pilotId() const;
128 128
129 void setTempSyncStat(int id); 129 void setTempSyncStat(int id);
130 int tempSyncStat() const; 130 int tempSyncStat() const;
131 void setIDStr( const QString & ); 131 void setIDStr( const QString & );
132 QString IDStr() const; 132 QString IDStr() const;
133 void setID( const QString &, const QString & ); 133 void setID( const QString &, const QString & );
134 QString getID( const QString & ); 134 QString getID( const QString & );
135 void setCsum( const QString &, const QString & ); 135 void setCsum( const QString &, const QString & );
136 QString getCsum( const QString & ); 136 QString getCsum( const QString & );
137 void removeID(const QString &); 137 void removeID(const QString &);
138 138
139 void registerObserver( Observer * ); 139 void registerObserver( Observer * );
140 void unRegisterObserver( Observer * ); 140 void unRegisterObserver( Observer * );
141 void updated(); 141 void updated();
142 142
143 protected: 143 protected:
144 bool mReadOnly; 144 bool mReadOnly;
145 QDateTime getEvenTime( QDateTime ); 145 QDateTime getEvenTime( QDateTime );
146 146
147 private: 147 private:
148 // base components 148 // base components
149 QDateTime mDtStart; 149 QDateTime mDtStart;
150 QString mOrganizer; 150 QString mOrganizer;
151 QString mUid; 151 QString mUid;
152 QDateTime mLastModified; 152 QDateTime mLastModified;
153 QPtrList<Attendee> mAttendees; 153 QPtrList<Attendee> mAttendees;
154 154
155 bool mFloats; 155 bool mFloats;
156 156
157 int mDuration; 157 int mDuration;
158 bool mHasDuration; 158 bool mHasDuration;
159 QString mExternalId; 159 QString mExternalId;
160 int mTempSyncStat; 160 int mTempSyncStat;
161 161
162 // PILOT SYNCHRONIZATION STUFF 162 // PILOT SYNCHRONIZATION STUFF
163 int mPilotId; // unique id for pilot sync 163 int mPilotId; // unique id for pilot sync
164 int mSyncStatus; // status (for sync) 164 int mSyncStatus; // status (for sync)
165 165
166 QPtrList<Observer> mObservers; 166 QPtrList<Observer> mObservers;
167}; 167};