-rw-r--r-- | korganizer/outgoingdialog.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/korganizer/outgoingdialog.cpp b/korganizer/outgoingdialog.cpp index 0fc90c4..7253c8e 100644 --- a/korganizer/outgoingdialog.cpp +++ b/korganizer/outgoingdialog.cpp @@ -34,100 +34,100 @@ #include <libkcal/dummyscheduler.h> #include <libkcal/icalformat.h> #include <libkcal/calendar.h> #ifndef KORG_NOMAIL #include "mailscheduler.h" #endif #include "koprefs.h" #include "outgoingdialog.h" #include "koeventviewerdialog.h" #include "docprefs.h" ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev, Scheduler::Method method, const QString &recipients) : QListViewItem(parent) { mIncidence = ev; mMethod = method; mRecipients = recipients; // kdDebug() << "ScheduleItemOut: setting the summary" << endl; //Set the summary - if(ev->type() != "FreeBusy") { + if(ev->typeID() != freebusyID ) { Incidence *incidence = static_cast<Incidence *>(ev); setText(0,incidence->summary()); } else { setText(0,i18n("Free Busy Object")); } // kdDebug() << "ScheduleItemOut: checking if the object is an event" << endl; //If the object is an event - if(ev->type()=="Event") { + if(ev->typeID()== eventID ) { Event *event = static_cast<Event *>(ev); setText(1,event->dtStartDateStr()); if (event->doesFloat()) { //If the event floats set the start and end times to no time setText(2,i18n("no time")); setText(4,i18n("no time")); } else { //If it does not float setText(2,event->dtStartTimeStr()); if (event->hasDuration()) { setText(4,event->dtEndTimeStr()); } else { setText(4,i18n("no time")); } } if (event->hasEndDate()) { setText(3,event->dtEndDateStr()); } else { setText(3,i18n("no time")); } } //If the object is an Todo - if(ev->type()=="Todo") { + if(ev->typeID() == todoID ) { Todo *event = static_cast<Todo *>(ev); if (event->hasStartDate()) { setText(1,event->dtStartDateStr()); if (!event->doesFloat()) { setText(2,event->dtStartTimeStr()); } } if (event->hasDueDate()) { setText(3,event->dtDueDateStr()); if (!event->doesFloat()) { setText(4,event->dtDueTimeStr()); } } } // kdDebug() << "ScheduleItemOut: checking if the object is a FreeBusy object" << endl; //If the object is a freebusy object - if(ev->type() == "FreeBusy") { + if(ev->typeID() == freebusyID ) { FreeBusy *freebusy = static_cast<FreeBusy *>(ev); setText(1,freebusy->dtStartDateStr()); setText(2,freebusy->dtStartTimeStr()); //Must try and get this to the users local settings setText(3,KGlobal::locale()->formatDate( freebusy->dtEnd().date() ) ); setText(4,KGlobal::locale()->formatTime( freebusy->dtEnd().time() ) ); } // kdDebug() << "ScheduleItemOut: Setting the method" << endl; //Set the Method setText(5,Scheduler::translatedMethodName(mMethod)); } OutgoingDialog::OutgoingDialog(Calendar *calendar,QWidget* parent, const char* name,bool modal, WFlags fl) : OutgoingDialog_base(parent,name,modal,fl) { mCalendar = calendar; mFormat = new ICalFormat; if (KOPrefs::instance()->mIMIPScheduler == KOPrefs::IMIPDummy ) { @@ -220,52 +220,52 @@ void OutgoingDialog::send() delete (oldItem->event()); delete oldItem; } } emit numMessagesChanged(mMessageListView->childCount()); } void OutgoingDialog::deleteItem() { ScheduleItemOut *item = (ScheduleItemOut *)(mMessageListView->selectedItem()); if(!item) return; deleteMessage(item->event()); delete(item->event()); mMessageListView->takeItem(item); emit numMessagesChanged(mMessageListView->childCount()); } void OutgoingDialog::showEvent(QListViewItem *qitem) { ScheduleItemOut *item = (ScheduleItemOut *)qitem; Event *event = 0; Todo *todo = 0; - if ( item->event()->type()=="Event" ) { + if ( item->event()->typeID() == eventID ) { event = static_cast<Event *>(item->event()); } - if ( item->event()->type()=="Todo" ) { + if ( item->event()->typeID() == todoID ) { todo = static_cast<Todo *>(item->event()); } QString sendText; if (event || todo) { KOEventViewerDialog *eventViewer = new KOEventViewerDialog(this); if (event) eventViewer->setEvent(event); if (todo) eventViewer->setTodo(todo); sendText = "<hr><h4>"+i18n("Event will be sent to:")+"</h4>"; switch (item->method()) { case Scheduler::Publish: { sendText += item->recipients(); break; } case Scheduler::Request: { sendText += i18n("All attendees"); break; } case Scheduler::Refresh: { sendText += i18n("All attendees"); break; } case Scheduler::Cancel: { sendText += i18n("All attendees"); break; } case Scheduler::Add: { sendText += i18n("All attendees"); break; } |