summaryrefslogtreecommitdiffabout
path: root/korganizer/incomingdialog.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/incomingdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/incomingdialog.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/korganizer/incomingdialog.cpp b/korganizer/incomingdialog.cpp
index 50e3077..fe78356 100644
--- a/korganizer/incomingdialog.cpp
+++ b/korganizer/incomingdialog.cpp
@@ -169,25 +169,25 @@ void IncomingDialog::setOutgoingDialog(OutgoingDialog *outgoing)
void IncomingDialog::retrieve()
{
QPtrList <ScheduleMessage> messages = mScheduler->retrieveTransactions();
ScheduleMessage *message;
for(message = messages.first();message;message = messages.next()) {
IncidenceBase *inc = message->event();
Scheduler::Method method = (Scheduler::Method)message->method();
ScheduleMessage::Status status = message->status();
ScheduleItemIn *item = new ScheduleItemIn(mMessageListView,inc,method,status);
- if(inc->type()!="FreeBusy") {
+ if(inc->typeID() != freebusyID ) {
Incidence *incidence = static_cast<Incidence *>(inc);
ScheduleItemVisitor v(item);
if (!incidence->accept(v)) delete item;
} else {
FreeBusy *fb = static_cast<FreeBusy *>(item->event());
item->setText(0, "FreeBusy");
item->setText(1, KGlobal::locale()->formatDate( fb->dtStart().date() ) );
item->setText(2, KGlobal::locale()->formatTime( fb->dtStart().time() ) );
item->setText(3, KGlobal::locale()->formatDate( fb->dtEnd().date() ) );
item->setText(4, KGlobal::locale()->formatTime( fb->dtEnd().time() ) );
item->setText(5, fb->organizer());
}
@@ -246,25 +246,25 @@ void IncomingDialog::rejectMessage()
{
ScheduleItemIn *item = (ScheduleItemIn *)mMessageListView->selectedItem();
if (item) {
mScheduler->deleteTransaction(item->event());
delete item;
emit numMessagesChanged(mMessageListView->childCount());
}
}
void IncomingDialog::showEvent(QListViewItem *item)
{
IncidenceBase *incidence = ((ScheduleItemIn *)item)->event();
- if( incidence && incidence->type() == "Event" ) {
+ if( incidence && incidence->typeID() == eventID ) {
Event *event = static_cast<Event *>(incidence);
KOEventViewerDialog *eventViewer = new KOEventViewerDialog(this);
eventViewer->setEvent(event);
eventViewer->show();
}
}
bool IncomingDialog::incomeRefresh(ScheduleItemIn *item)
{
Event *ev = mCalendar->event(item->event()->uid());
if (ev) {
//user interaction before??
@@ -281,25 +281,25 @@ bool IncomingDialog::incomeRefresh(ScheduleItemIn *item)
return true;
}
mScheduler->deleteTransaction(item->event());
delete item;
emit numMessagesChanged(mMessageListView->childCount());
return false;
}
bool IncomingDialog::incomeCounter(ScheduleItemIn *item)
{
IncidenceBase *incidence = ((ScheduleItemIn *)item)->event();
// currently only events supportet - attetion at insertion below!
- if ( incidence->type() != "Event" ) return false;
+ if ( incidence->typeID() != eventID ) return false;
Event *counterEvent = static_cast<Event *>( incidence );
Event *even = mCalendar->event(counterEvent->uid());
KOCounterDialog *eventViewer = new KOCounterDialog(this);
eventViewer->addText(i18n("counter proposal event","<b>Counter-event:</b><p>"));
eventViewer->addEvent(counterEvent);
eventViewer->addText("<hr>");
eventViewer->addText(i18n("<b>Original event:</b><p>"));
if (even) eventViewer->addEvent(even);
else eventViewer->addText(i18n("A corresponding event is missing in your calendar!"));
@@ -359,25 +359,25 @@ bool IncomingDialog::incomeDeclineCounter(ScheduleItemIn *item)
emit numMessagesChanged(mMessageListView->childCount());
return true;
}
mScheduler->deleteTransaction(item->event());
delete item;
emit numMessagesChanged(mMessageListView->childCount());
return false;
}
bool IncomingDialog::incomeAdd(ScheduleItemIn *item)
{
IncidenceBase *incidence = ((ScheduleItemIn *)item)->event();
- if (incidence->type() == "Event" ) {
+ if (incidence->typeID() == eventID ) {
Event *refr = static_cast<Event *>( incidence );
mOutgoing->addMessage(refr,Scheduler::Refresh);
mScheduler->deleteTransaction( incidence );
delete item;
emit numMessagesChanged(mMessageListView->childCount());
return true;
}
else {
kdDebug() << "IncomingDialog::incomeAdd - only Events are supportet yet" << endl;
mScheduler->deleteTransaction( incidence );
delete item;
emit numMessagesChanged(mMessageListView->childCount());
@@ -393,25 +393,25 @@ bool IncomingDialog::incomeDefault(ScheduleItemIn *item)
return true;
}
else {
KMessageBox::error(this,i18n("Unable to accept the IMIP-message. It may be a problem with the email addresses."));
kdDebug() << "IncomingDialog::acceptMessage(): Error!" << endl;
return false;
}
return false;
}
bool IncomingDialog::incomeRequest(ScheduleItemIn *item)
{
- if (item->event()->type()=="FreeBusy") {
+ if (item->event()->typeID() == freebusyID ) {
//handel freebusy request
IncidenceBase *inc = item->event();
QDateTime start = inc->dtStart();
QDateTime end = start.addDays(inc->duration()/86400);
FreeBusy *freebusy = new FreeBusy(mCalendar, start, end);
freebusy->setOrganizer(inc->organizer());
Attendee *att = new Attendee(KOPrefs::instance()->fullName(),
KOPrefs::instance()->email());
freebusy->addAttendee(att);
kdDebug() << "calendarview: schedule_publish_freebusy: startDate: "
@@ -428,25 +428,25 @@ bool IncomingDialog::incomeRequest(ScheduleItemIn *item)
} else {
return incomeDefault(item);
}
return false;
}
bool IncomingDialog::automaticAction(ScheduleItemIn *item)
{
bool autoAction = false;
IncidenceBase *inc = item->event();
Scheduler::Method method = item->method();
- if( inc->type()=="FreeBusy" ) {
+ if( inc->typeID() == freebusyID ) {
if ( method==Scheduler::Request ) {
if ( KOPrefs::instance()->mIMIPAutoFreeBusy==KOPrefs::addressbookAuto ) {
// reply freebusy information
if ( checkOrganizerInAddressbook(inc->organizer()) ) {
incomeRequest(item);
}
} else return false;
} else {
if ( method==Scheduler::Reply ) {
if ( KOPrefs::instance()->mIMIPAutoFreeBusy==KOPrefs::addressbookAuto ) {
// insert freebusy information
@@ -456,25 +456,25 @@ bool IncomingDialog::automaticAction(ScheduleItemIn *item)
} else {
if ( method==Scheduler::Publish) {
if ( KOPrefs::instance()->mIMIPAutoFreeBusy==KOPrefs::addressbookAuto ) {
// insert freebusy information
//if ( checkOrganizerInAddressbook(inc->organizer()) )
}
} else return false;
}
}
}
- if ( inc->type()=="Event" ) {
+ if ( inc->typeID() == eventID ) {
if ( method==Scheduler::Request || method==Scheduler::Publish ) {
if ( KOPrefs::instance()->mIMIPAutoInsertRequest==KOPrefs::addressbookAuto ) {
// insert event
if ( checkOrganizerInAddressbook(inc->organizer()) )
autoAction = acceptMessage(item);
} else return false;
} else {
if ( method==Scheduler::Reply ) {
if ( KOPrefs::instance()->mIMIPAutoInsertReply==KOPrefs::addressbookAuto ) {
// update event information
if ( checkAttendeesInAddressbook(inc) )