summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/incomingdialog.cpp14
-rw-r--r--korganizer/koagendaview.cpp14
-rw-r--r--korganizer/koeditorrecurrence.cpp2
-rw-r--r--korganizer/koeventviewerdialog.cpp12
-rw-r--r--korganizer/komonthview.cpp4
-rw-r--r--korganizer/outgoingdialog.cpp12
-rw-r--r--libkcal/alarm.cpp4
7 files changed, 31 insertions, 31 deletions
diff --git a/korganizer/incomingdialog.cpp b/korganizer/incomingdialog.cpp
index 50e3077..fe78356 100644
--- a/korganizer/incomingdialog.cpp
+++ b/korganizer/incomingdialog.cpp
@@ -175,13 +175,13 @@ void IncomingDialog::retrieve()
175 for(message = messages.first();message;message = messages.next()) { 175 for(message = messages.first();message;message = messages.next()) {
176 IncidenceBase *inc = message->event(); 176 IncidenceBase *inc = message->event();
177 Scheduler::Method method = (Scheduler::Method)message->method(); 177 Scheduler::Method method = (Scheduler::Method)message->method();
178 ScheduleMessage::Status status = message->status(); 178 ScheduleMessage::Status status = message->status();
179 179
180 ScheduleItemIn *item = new ScheduleItemIn(mMessageListView,inc,method,status); 180 ScheduleItemIn *item = new ScheduleItemIn(mMessageListView,inc,method,status);
181 if(inc->type()!="FreeBusy") { 181 if(inc->typeID() != freebusyID ) {
182 Incidence *incidence = static_cast<Incidence *>(inc); 182 Incidence *incidence = static_cast<Incidence *>(inc);
183 ScheduleItemVisitor v(item); 183 ScheduleItemVisitor v(item);
184 if (!incidence->accept(v)) delete item; 184 if (!incidence->accept(v)) delete item;
185 } else { 185 } else {
186 FreeBusy *fb = static_cast<FreeBusy *>(item->event()); 186 FreeBusy *fb = static_cast<FreeBusy *>(item->event());
187 item->setText(0, "FreeBusy"); 187 item->setText(0, "FreeBusy");
@@ -252,13 +252,13 @@ void IncomingDialog::rejectMessage()
252 } 252 }
253} 253}
254 254
255void IncomingDialog::showEvent(QListViewItem *item) 255void IncomingDialog::showEvent(QListViewItem *item)
256{ 256{
257 IncidenceBase *incidence = ((ScheduleItemIn *)item)->event(); 257 IncidenceBase *incidence = ((ScheduleItemIn *)item)->event();
258 if( incidence && incidence->type() == "Event" ) { 258 if( incidence && incidence->typeID() == eventID ) {
259 Event *event = static_cast<Event *>(incidence); 259 Event *event = static_cast<Event *>(incidence);
260 KOEventViewerDialog *eventViewer = new KOEventViewerDialog(this); 260 KOEventViewerDialog *eventViewer = new KOEventViewerDialog(this);
261 eventViewer->setEvent(event); 261 eventViewer->setEvent(event);
262 eventViewer->show(); 262 eventViewer->show();
263 } 263 }
264} 264}
@@ -287,13 +287,13 @@ bool IncomingDialog::incomeRefresh(ScheduleItemIn *item)
287} 287}
288 288
289bool IncomingDialog::incomeCounter(ScheduleItemIn *item) 289bool IncomingDialog::incomeCounter(ScheduleItemIn *item)
290{ 290{
291 IncidenceBase *incidence = ((ScheduleItemIn *)item)->event(); 291 IncidenceBase *incidence = ((ScheduleItemIn *)item)->event();
292 // currently only events supportet - attetion at insertion below! 292 // currently only events supportet - attetion at insertion below!
293 if ( incidence->type() != "Event" ) return false; 293 if ( incidence->typeID() != eventID ) return false;
294 294
295 Event *counterEvent = static_cast<Event *>( incidence ); 295 Event *counterEvent = static_cast<Event *>( incidence );
296 296
297 Event *even = mCalendar->event(counterEvent->uid()); 297 Event *even = mCalendar->event(counterEvent->uid());
298 298
299 KOCounterDialog *eventViewer = new KOCounterDialog(this); 299 KOCounterDialog *eventViewer = new KOCounterDialog(this);
@@ -365,13 +365,13 @@ bool IncomingDialog::incomeDeclineCounter(ScheduleItemIn *item)
365 return false; 365 return false;
366} 366}
367 367
368bool IncomingDialog::incomeAdd(ScheduleItemIn *item) 368bool IncomingDialog::incomeAdd(ScheduleItemIn *item)
369{ 369{
370 IncidenceBase *incidence = ((ScheduleItemIn *)item)->event(); 370 IncidenceBase *incidence = ((ScheduleItemIn *)item)->event();
371 if (incidence->type() == "Event" ) { 371 if (incidence->typeID() == eventID ) {
372 Event *refr = static_cast<Event *>( incidence ); 372 Event *refr = static_cast<Event *>( incidence );
373 mOutgoing->addMessage(refr,Scheduler::Refresh); 373 mOutgoing->addMessage(refr,Scheduler::Refresh);
374 mScheduler->deleteTransaction( incidence ); 374 mScheduler->deleteTransaction( incidence );
375 delete item; 375 delete item;
376 emit numMessagesChanged(mMessageListView->childCount()); 376 emit numMessagesChanged(mMessageListView->childCount());
377 return true; 377 return true;
@@ -399,13 +399,13 @@ bool IncomingDialog::incomeDefault(ScheduleItemIn *item)
399 } 399 }
400 return false; 400 return false;
401} 401}
402 402
403bool IncomingDialog::incomeRequest(ScheduleItemIn *item) 403bool IncomingDialog::incomeRequest(ScheduleItemIn *item)
404{ 404{
405 if (item->event()->type()=="FreeBusy") { 405 if (item->event()->typeID() == freebusyID ) {
406 //handel freebusy request 406 //handel freebusy request
407 IncidenceBase *inc = item->event(); 407 IncidenceBase *inc = item->event();
408 QDateTime start = inc->dtStart(); 408 QDateTime start = inc->dtStart();
409 QDateTime end = start.addDays(inc->duration()/86400); 409 QDateTime end = start.addDays(inc->duration()/86400);
410 410
411 FreeBusy *freebusy = new FreeBusy(mCalendar, start, end); 411 FreeBusy *freebusy = new FreeBusy(mCalendar, start, end);
@@ -434,13 +434,13 @@ bool IncomingDialog::incomeRequest(ScheduleItemIn *item)
434bool IncomingDialog::automaticAction(ScheduleItemIn *item) 434bool IncomingDialog::automaticAction(ScheduleItemIn *item)
435{ 435{
436 bool autoAction = false; 436 bool autoAction = false;
437 IncidenceBase *inc = item->event(); 437 IncidenceBase *inc = item->event();
438 Scheduler::Method method = item->method(); 438 Scheduler::Method method = item->method();
439 439
440 if( inc->type()=="FreeBusy" ) { 440 if( inc->typeID() == freebusyID ) {
441 if ( method==Scheduler::Request ) { 441 if ( method==Scheduler::Request ) {
442 if ( KOPrefs::instance()->mIMIPAutoFreeBusy==KOPrefs::addressbookAuto ) { 442 if ( KOPrefs::instance()->mIMIPAutoFreeBusy==KOPrefs::addressbookAuto ) {
443 // reply freebusy information 443 // reply freebusy information
444 if ( checkOrganizerInAddressbook(inc->organizer()) ) { 444 if ( checkOrganizerInAddressbook(inc->organizer()) ) {
445 incomeRequest(item); 445 incomeRequest(item);
446 } 446 }
@@ -462,13 +462,13 @@ bool IncomingDialog::automaticAction(ScheduleItemIn *item)
462 } 462 }
463 } else return false; 463 } else return false;
464 } 464 }
465 } 465 }
466 } 466 }
467 467
468 if ( inc->type()=="Event" ) { 468 if ( inc->typeID() == eventID ) {
469 if ( method==Scheduler::Request || method==Scheduler::Publish ) { 469 if ( method==Scheduler::Request || method==Scheduler::Publish ) {
470 if ( KOPrefs::instance()->mIMIPAutoInsertRequest==KOPrefs::addressbookAuto ) { 470 if ( KOPrefs::instance()->mIMIPAutoInsertRequest==KOPrefs::addressbookAuto ) {
471 // insert event 471 // insert event
472 if ( checkOrganizerInAddressbook(inc->organizer()) ) 472 if ( checkOrganizerInAddressbook(inc->organizer()) )
473 autoAction = acceptMessage(item); 473 autoAction = acceptMessage(item);
474 } else return false; 474 } else return false;
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 1320a2e..b2b136a 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -578,13 +578,13 @@ void KOAgendaView::toggleAllDay()
578} 578}
579void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) 579void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld )
580{ 580{
581 calendar()->addIncidence( inc ); 581 calendar()->addIncidence( inc );
582 582
583 if ( incOld ) { 583 if ( incOld ) {
584 if ( incOld->type() == "Todo" ) 584 if ( incOld->typeID() == todoID )
585 emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED ); 585 emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED );
586 else 586 else
587 emit incidenceChanged(incOld, KOGlobals::EVENTEDITED); 587 emit incidenceChanged(incOld, KOGlobals::EVENTEDITED);
588 } 588 }
589 589
590} 590}
@@ -964,21 +964,21 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
964 // if ( type == KOAgenda::RESIZETOP ) 964 // if ( type == KOAgenda::RESIZETOP )
965 // qDebug("RESIZETOP "); 965 // qDebug("RESIZETOP ");
966 // if ( type == KOAgenda::RESIZEBOTTOM ) 966 // if ( type == KOAgenda::RESIZEBOTTOM )
967 // qDebug("RESIZEBOTTOM "); 967 // qDebug("RESIZEBOTTOM ");
968 // if ( type == KOAgenda::MOVE ) 968 // if ( type == KOAgenda::MOVE )
969 // qDebug("MOVE "); 969 // qDebug("MOVE ");
970 if ( item->incidence()->type() == "Event" ) { 970 if ( item->incidence()->typeID() == eventID ) {
971 startDt =item->incidence()->dtStart(); 971 startDt =item->incidence()->dtStart();
972 endDt = item->incidence()->dtEnd(); 972 endDt = item->incidence()->dtEnd();
973 lenInSecs = startDt.secsTo( endDt ); 973 lenInSecs = startDt.secsTo( endDt );
974 } 974 }
975 975
976 // emit incidenceItemChanged( item->incidence(), KOGlobals::EVENTEDITED ); 976 // emit incidenceItemChanged( item->incidence(), KOGlobals::EVENTEDITED );
977 977
978 if ( item->incidence()->type()=="Todo" && item->mLastMoveXPos > 0 ) { 978 if ( item->incidence()->typeID()== todoID && item->mLastMoveXPos > 0 ) {
979 startDate = mSelectedDates[item->mLastMoveXPos]; 979 startDate = mSelectedDates[item->mLastMoveXPos];
980 } else { 980 } else {
981 if (item->cellX() < 0) { 981 if (item->cellX() < 0) {
982 startDate = (mSelectedDates.first()).addDays(item->cellX()); 982 startDate = (mSelectedDates.first()).addDays(item->cellX());
983 } else { 983 } else {
984 startDate = mSelectedDates[item->cellX()]; 984 startDate = mSelectedDates[item->cellX()];
@@ -988,13 +988,13 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
988 988
989 if (item->incidence()->doesFloat()) { 989 if (item->incidence()->doesFloat()) {
990 endDt.setDate(startDate.addDays(item->cellWidth() - 1)); 990 endDt.setDate(startDate.addDays(item->cellWidth() - 1));
991 } else { 991 } else {
992 if ( type == KOAgenda::RESIZETOP || type == KOAgenda::MOVE ) 992 if ( type == KOAgenda::RESIZETOP || type == KOAgenda::MOVE )
993 startDt.setTime(mAgenda->gyToTime(item->cellYTop())); 993 startDt.setTime(mAgenda->gyToTime(item->cellYTop()));
994 if ( item->incidence()->type() == "Event" ) { 994 if ( item->incidence()->typeID() == eventID ) {
995 if ( type == KOAgenda::MOVE ) { 995 if ( type == KOAgenda::MOVE ) {
996 endDt = startDt.addSecs(lenInSecs); 996 endDt = startDt.addSecs(lenInSecs);
997 997
998 } else if ( type == KOAgenda::RESIZEBOTTOM ) { 998 } else if ( type == KOAgenda::RESIZEBOTTOM ) {
999 if (item->lastMultiItem()) { 999 if (item->lastMultiItem()) {
1000 endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); 1000 endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1));
@@ -1018,16 +1018,16 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
1018 else 1018 else
1019 endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time()); 1019 endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time());
1020 endDt.setDate(startDate); 1020 endDt.setDate(startDate);
1021 } 1021 }
1022 } 1022 }
1023 } 1023 }
1024 if ( item->incidence()->type() == "Event" ) { 1024 if ( item->incidence()->typeID() == eventID ) {
1025 item->incidence()->setDtStart(startDt); 1025 item->incidence()->setDtStart(startDt);
1026 (static_cast<Event*>(item->incidence()))->setDtEnd(endDt); 1026 (static_cast<Event*>(item->incidence()))->setDtEnd(endDt);
1027 } else if ( item->incidence()->type() == "Todo" ) { 1027 } else if ( item->incidence()->typeID() == todoID ) {
1028 Todo* to = static_cast<Todo*>(item->incidence()); 1028 Todo* to = static_cast<Todo*>(item->incidence());
1029 1029
1030 to->setDtDue(endDt); 1030 to->setDtDue(endDt);
1031 if ( to->hasStartDate() ) { 1031 if ( to->hasStartDate() ) {
1032 if (to->dtStart() >= to->dtDue() ) 1032 if (to->dtStart() >= to->dtDue() )
1033 to->setDtStart(to->dtDue().addDays( -2 )); 1033 to->setDtStart(to->dtDue().addDays( -2 ));
@@ -1035,13 +1035,13 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
1035 1035
1036 } 1036 }
1037 //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() ); 1037 //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() );
1038 item->incidence()->setRevision(item->incidence()->revision()+1); 1038 item->incidence()->setRevision(item->incidence()->revision()+1);
1039 item->setItemDate(startDt.date()); 1039 item->setItemDate(startDt.date());
1040 //item->updateItem(); 1040 //item->updateItem();
1041 if ( item->incidence()->type() == "Todo" ) { 1041 if ( item->incidence()->typeID() == todoID ) {
1042 emit todoMoved((Todo*)item->incidence(), KOGlobals::EVENTEDITED ); 1042 emit todoMoved((Todo*)item->incidence(), KOGlobals::EVENTEDITED );
1043 1043
1044 } 1044 }
1045 else 1045 else
1046 emit incidenceChanged(item->incidence(), KOGlobals::EVENTEDITED); 1046 emit incidenceChanged(item->incidence(), KOGlobals::EVENTEDITED);
1047 item->updateItem(); 1047 item->updateItem();
diff --git a/korganizer/koeditorrecurrence.cpp b/korganizer/koeditorrecurrence.cpp
index e165017..dea8981 100644
--- a/korganizer/koeditorrecurrence.cpp
+++ b/korganizer/koeditorrecurrence.cpp
@@ -868,13 +868,13 @@ void KOEditorRecurrence::setDefaults( QDateTime from, QDateTime to, bool )
868} 868}
869 869
870void KOEditorRecurrence::readEvent(Incidence *event) 870void KOEditorRecurrence::readEvent(Incidence *event)
871{ 871{
872 872
873 QDateTime dtEnd; 873 QDateTime dtEnd;
874 if ( event->type() == "Event" ) 874 if ( event->typeID() == eventID )
875 dtEnd = ((Event*)event)->dtEnd(); 875 dtEnd = ((Event*)event)->dtEnd();
876 else 876 else
877 dtEnd = ((Todo*)event)->dtDue(); 877 dtEnd = ((Todo*)event)->dtDue();
878 878
879 setDefaults( event->dtStart(), dtEnd, true ); 879 setDefaults( event->dtStart(), dtEnd, true );
880 QBitArray rDays( 7 ); 880 QBitArray rDays( 7 );
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index e5ff8af..02f13c7 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -145,26 +145,26 @@ void KOEventViewerDialog::setEvent(Event *event)
145 if ( !mSyncMode ) { 145 if ( !mSyncMode ) {
146 findButton( User1 )->setText( i18n("Agenda")); 146 findButton( User1 )->setText( i18n("Agenda"));
147 } 147 }
148} 148}
149void KOEventViewerDialog::setIncidence(Incidence *in ) 149void KOEventViewerDialog::setIncidence(Incidence *in )
150{ 150{
151 if ( in->type() == "Event" ) 151 if ( in->typeID() == eventID )
152 setEvent( (Event*) in ); 152 setEvent( (Event*) in );
153 else if ( in->type() =="Todo" ) 153 else if ( in->typeID() == todoID )
154 setTodo( (Todo*) in ); 154 setTodo( (Todo*) in );
155 else if ( in->type() =="Journal" ) 155 else if ( in->typeID() == journalID )
156 setJournal( (Journal*) in ); 156 setJournal( (Journal*) in );
157} 157}
158void KOEventViewerDialog::addIncidence(Incidence *in) 158void KOEventViewerDialog::addIncidence(Incidence *in)
159{ 159{
160 if ( in->type() == "Event" ) 160 if ( in->typeID() == eventID )
161 addEvent( (Event*) in ); 161 addEvent( (Event*) in );
162 else if ( in->type() =="Todo" ) 162 else if ( in->typeID() == todoID )
163 mEventViewer->setTodo( (Todo*) in, false ); 163 mEventViewer->setTodo( (Todo*) in, false );
164 else if ( in->type() =="Journal" ) 164 else if ( in->typeID() == journalID )
165 mEventViewer->setJournal( (Journal*) in, false ); 165 mEventViewer->setJournal( (Journal*) in, false );
166 if ( mSyncMode ) { 166 if ( mSyncMode ) {
167 findButton( User1 )->setFocus(); 167 findButton( User1 )->setFocus();
168 setCaption(i18n("Conflict! Please choose entry")); 168 setCaption(i18n("Conflict! Please choose entry"));
169 } 169 }
170} 170}
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 678cab6..c868270 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -379,13 +379,13 @@ void MonthViewItem::paint(QPainter *p)
379 379
380 } 380 }
381 x += sizeM/2 + 1; 381 x += sizeM/2 + 1;
382 x += sizeM + 1; 382 x += sizeM + 1;
383 } 383 }
384 384
385 if ( mIncidence->type() == "Todo" ){ 385 if ( mIncidence->typeID() == todoID ){
386 Todo* td = ( Todo* ) mIncidence; 386 Todo* td = ( Todo* ) mIncidence;
387 if ( td->isCompleted() ) { 387 if ( td->isCompleted() ) {
388 int half = size/2; 388 int half = size/2;
389 p->drawLine ( x, heihei/2, x +half , heihei/2 +half ) ; 389 p->drawLine ( x, heihei/2, x +half , heihei/2 +half ) ;
390 p->drawLine ( x +half , heihei/2 +half , x +half+half +2 , heihei/2 -2 ) ; 390 p->drawLine ( x +half , heihei/2 +half , x +half+half +2 , heihei/2 -2 ) ;
391 x += half+half + 4; 391 x += half+half + 4;
@@ -1940,13 +1940,13 @@ void KOMonthView::showContextMenu( Incidence *incidence )
1940 mContextMenu->showIncidencePopup(incidence); 1940 mContextMenu->showIncidencePopup(incidence);
1941 else { 1941 else {
1942 //qDebug("KOMonthView::showContextMenu "); 1942 //qDebug("KOMonthView::showContextMenu ");
1943 mNewItemMenu->popup(QCursor::pos()); 1943 mNewItemMenu->popup(QCursor::pos());
1944 } 1944 }
1945 /* 1945 /*
1946 if( incidence && incidence->type() == "Event" ) { 1946 if( incidence && incidence->typeID() == eventID ) {
1947 Event *event = static_cast<Event *>(incidence); 1947 Event *event = static_cast<Event *>(incidence);
1948 mContextMenu->showEventPopup(event); 1948 mContextMenu->showEventPopup(event);
1949 } else { 1949 } else {
1950 kdDebug() << "MonthView::showContextMenu(): cast failed." << endl; 1950 kdDebug() << "MonthView::showContextMenu(): cast failed." << endl;
1951 } 1951 }
1952 */ 1952 */
diff --git a/korganizer/outgoingdialog.cpp b/korganizer/outgoingdialog.cpp
index 0fc90c4..7253c8e 100644
--- a/korganizer/outgoingdialog.cpp
+++ b/korganizer/outgoingdialog.cpp
@@ -52,22 +52,22 @@ ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev,
52 mIncidence = ev; 52 mIncidence = ev;
53 mMethod = method; 53 mMethod = method;
54 mRecipients = recipients; 54 mRecipients = recipients;
55 55
56// kdDebug() << "ScheduleItemOut: setting the summary" << endl; 56// kdDebug() << "ScheduleItemOut: setting the summary" << endl;
57 //Set the summary 57 //Set the summary
58 if(ev->type() != "FreeBusy") { 58 if(ev->typeID() != freebusyID ) {
59 Incidence *incidence = static_cast<Incidence *>(ev); 59 Incidence *incidence = static_cast<Incidence *>(ev);
60 setText(0,incidence->summary()); 60 setText(0,incidence->summary());
61 } else { 61 } else {
62 setText(0,i18n("Free Busy Object")); 62 setText(0,i18n("Free Busy Object"));
63 } 63 }
64 64
65// kdDebug() << "ScheduleItemOut: checking if the object is an event" << endl; 65// kdDebug() << "ScheduleItemOut: checking if the object is an event" << endl;
66 //If the object is an event 66 //If the object is an event
67 if(ev->type()=="Event") { 67 if(ev->typeID()== eventID ) {
68 Event *event = static_cast<Event *>(ev); 68 Event *event = static_cast<Event *>(ev);
69 69
70 setText(1,event->dtStartDateStr()); 70 setText(1,event->dtStartDateStr());
71 if (event->doesFloat()) { //If the event floats set the start and end times to no time 71 if (event->doesFloat()) { //If the event floats set the start and end times to no time
72 setText(2,i18n("no time")); 72 setText(2,i18n("no time"));
73 setText(4,i18n("no time")); 73 setText(4,i18n("no time"));
@@ -85,13 +85,13 @@ ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev,
85 else { 85 else {
86 setText(3,i18n("no time")); 86 setText(3,i18n("no time"));
87 } 87 }
88 } 88 }
89 89
90 //If the object is an Todo 90 //If the object is an Todo
91 if(ev->type()=="Todo") { 91 if(ev->typeID() == todoID ) {
92 Todo *event = static_cast<Todo *>(ev); 92 Todo *event = static_cast<Todo *>(ev);
93 if (event->hasStartDate()) { 93 if (event->hasStartDate()) {
94 setText(1,event->dtStartDateStr()); 94 setText(1,event->dtStartDateStr());
95 if (!event->doesFloat()) { 95 if (!event->doesFloat()) {
96 setText(2,event->dtStartTimeStr()); 96 setText(2,event->dtStartTimeStr());
97 } 97 }
@@ -103,13 +103,13 @@ ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev,
103 } 103 }
104 } 104 }
105 } 105 }
106 106
107// kdDebug() << "ScheduleItemOut: checking if the object is a FreeBusy object" << endl; 107// kdDebug() << "ScheduleItemOut: checking if the object is a FreeBusy object" << endl;
108 //If the object is a freebusy object 108 //If the object is a freebusy object
109 if(ev->type() == "FreeBusy") { 109 if(ev->typeID() == freebusyID ) {
110 FreeBusy *freebusy = static_cast<FreeBusy *>(ev); 110 FreeBusy *freebusy = static_cast<FreeBusy *>(ev);
111 111
112 setText(1,freebusy->dtStartDateStr()); 112 setText(1,freebusy->dtStartDateStr());
113 setText(2,freebusy->dtStartTimeStr()); 113 setText(2,freebusy->dtStartTimeStr());
114 //Must try and get this to the users local settings 114 //Must try and get this to the users local settings
115 setText(3,KGlobal::locale()->formatDate( freebusy->dtEnd().date() ) ); 115 setText(3,KGlobal::locale()->formatDate( freebusy->dtEnd().date() ) );
@@ -238,16 +238,16 @@ void OutgoingDialog::deleteItem()
238 238
239void OutgoingDialog::showEvent(QListViewItem *qitem) 239void OutgoingDialog::showEvent(QListViewItem *qitem)
240{ 240{
241 ScheduleItemOut *item = (ScheduleItemOut *)qitem; 241 ScheduleItemOut *item = (ScheduleItemOut *)qitem;
242 Event *event = 0; 242 Event *event = 0;
243 Todo *todo = 0; 243 Todo *todo = 0;
244 if ( item->event()->type()=="Event" ) { 244 if ( item->event()->typeID() == eventID ) {
245 event = static_cast<Event *>(item->event()); 245 event = static_cast<Event *>(item->event());
246 } 246 }
247 if ( item->event()->type()=="Todo" ) { 247 if ( item->event()->typeID() == todoID ) {
248 todo = static_cast<Todo *>(item->event()); 248 todo = static_cast<Todo *>(item->event());
249 } 249 }
250 QString sendText; 250 QString sendText;
251 if (event || todo) { 251 if (event || todo) {
252 KOEventViewerDialog *eventViewer = new KOEventViewerDialog(this); 252 KOEventViewerDialog *eventViewer = new KOEventViewerDialog(this);
253 if (event) eventViewer->setEvent(event); 253 if (event) eventViewer->setEvent(event);
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp
index 6de1566..0afa0a7 100644
--- a/libkcal/alarm.cpp
+++ b/libkcal/alarm.cpp
@@ -335,13 +335,13 @@ void Alarm::setTime(const QDateTime &alarmTime)
335 335
336 mParent->updated(); 336 mParent->updated();
337} 337}
338int Alarm::offset() 338int Alarm::offset()
339{ 339{
340 if ( hasTime() ) { 340 if ( hasTime() ) {
341 if (mParent->type()=="Todo") { 341 if (mParent->typeID() == todoID ) {
342 Todo *t = static_cast<Todo*>(mParent); 342 Todo *t = static_cast<Todo*>(mParent);
343 return t->dtDue().secsTo( mAlarmTime ) ; 343 return t->dtDue().secsTo( mAlarmTime ) ;
344 } else 344 } else
345 return mParent->dtStart().secsTo( mAlarmTime ) ; 345 return mParent->dtStart().secsTo( mAlarmTime ) ;
346 } 346 }
347 else 347 else
@@ -378,13 +378,13 @@ QString Alarm::offsetText()
378QDateTime Alarm::time() const 378QDateTime Alarm::time() const
379{ 379{
380 if ( hasTime() ) 380 if ( hasTime() )
381 return mAlarmTime; 381 return mAlarmTime;
382 else 382 else
383 { 383 {
384 if (mParent->type()=="Todo") { 384 if (mParent->typeID() == todoID ) {
385 Todo *t = static_cast<Todo*>(mParent); 385 Todo *t = static_cast<Todo*>(mParent);
386 return mOffset.end( t->dtDue() ); 386 return mOffset.end( t->dtDue() );
387 } else if (mEndOffset) { 387 } else if (mEndOffset) {
388 return mOffset.end( mParent->dtEnd() ); 388 return mOffset.end( mParent->dtEnd() );
389 } else { 389 } else {
390 return mOffset.end( mParent->dtStart() ); 390 return mOffset.end( mParent->dtStart() );