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
@@ -157,49 +157,49 @@ IncomingDialog::IncomingDialog(Calendar *calendar,OutgoingDialog *outgoing,
157/* 157/*
158 * Destroys the object and frees any allocated resources 158 * Destroys the object and frees any allocated resources
159 */ 159 */
160IncomingDialog::~IncomingDialog() 160IncomingDialog::~IncomingDialog()
161{ 161{
162 // no need to delete child widgets, Qt does it all for us 162 // no need to delete child widgets, Qt does it all for us
163} 163}
164 164
165void IncomingDialog::setOutgoingDialog(OutgoingDialog *outgoing) 165void IncomingDialog::setOutgoingDialog(OutgoingDialog *outgoing)
166{ 166{
167 mOutgoing = outgoing; 167 mOutgoing = outgoing;
168} 168}
169 169
170void IncomingDialog::retrieve() 170void IncomingDialog::retrieve()
171{ 171{
172 QPtrList <ScheduleMessage> messages = mScheduler->retrieveTransactions(); 172 QPtrList <ScheduleMessage> messages = mScheduler->retrieveTransactions();
173 173
174 ScheduleMessage *message; 174 ScheduleMessage *message;
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");
188 item->setText(1, KGlobal::locale()->formatDate( fb->dtStart().date() ) ); 188 item->setText(1, KGlobal::locale()->formatDate( fb->dtStart().date() ) );
189 item->setText(2, KGlobal::locale()->formatTime( fb->dtStart().time() ) ); 189 item->setText(2, KGlobal::locale()->formatTime( fb->dtStart().time() ) );
190 item->setText(3, KGlobal::locale()->formatDate( fb->dtEnd().date() ) ); 190 item->setText(3, KGlobal::locale()->formatDate( fb->dtEnd().date() ) );
191 item->setText(4, KGlobal::locale()->formatTime( fb->dtEnd().time() ) ); 191 item->setText(4, KGlobal::locale()->formatTime( fb->dtEnd().time() ) );
192 item->setText(5, fb->organizer()); 192 item->setText(5, fb->organizer());
193 } 193 }
194 automaticAction(item); 194 automaticAction(item);
195 } 195 }
196 emit numMessagesChanged(mMessageListView->childCount()); 196 emit numMessagesChanged(mMessageListView->childCount());
197} 197}
198 198
199void IncomingDialog::acceptAllMessages() 199void IncomingDialog::acceptAllMessages()
200{ 200{
201 bool success = false; 201 bool success = false;
202 202
203 ScheduleItemIn *item = (ScheduleItemIn *)mMessageListView->firstChild(); 203 ScheduleItemIn *item = (ScheduleItemIn *)mMessageListView->firstChild();
204 while(item) { 204 while(item) {
205 ScheduleItemIn *nextitem = (ScheduleItemIn *)(item->nextSibling()); 205 ScheduleItemIn *nextitem = (ScheduleItemIn *)(item->nextSibling());
@@ -234,84 +234,84 @@ bool IncomingDialog::acceptMessage(ScheduleItemIn *item)
234 return incomeAdd(item); 234 return incomeAdd(item);
235 break; 235 break;
236 case Scheduler::Request: 236 case Scheduler::Request:
237 return incomeRequest(item); 237 return incomeRequest(item);
238 break; 238 break;
239 default: 239 default:
240 return incomeDefault(item); 240 return incomeDefault(item);
241 } 241 }
242 return false; 242 return false;
243} 243}
244 244
245void IncomingDialog::rejectMessage() 245void IncomingDialog::rejectMessage()
246{ 246{
247 ScheduleItemIn *item = (ScheduleItemIn *)mMessageListView->selectedItem(); 247 ScheduleItemIn *item = (ScheduleItemIn *)mMessageListView->selectedItem();
248 if (item) { 248 if (item) {
249 mScheduler->deleteTransaction(item->event()); 249 mScheduler->deleteTransaction(item->event());
250 delete item; 250 delete item;
251 emit numMessagesChanged(mMessageListView->childCount()); 251 emit numMessagesChanged(mMessageListView->childCount());
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}
265 265
266bool IncomingDialog::incomeRefresh(ScheduleItemIn *item) 266bool IncomingDialog::incomeRefresh(ScheduleItemIn *item)
267{ 267{
268 Event *ev = mCalendar->event(item->event()->uid()); 268 Event *ev = mCalendar->event(item->event()->uid());
269 if (ev) { 269 if (ev) {
270 //user interaction before?? 270 //user interaction before??
271 Attendee *att; 271 Attendee *att;
272 QPtrList<Attendee> attlist = ev->attendees(); 272 QPtrList<Attendee> attlist = ev->attendees();
273 for (att=attlist.first(); att; att=attlist.next()) { 273 for (att=attlist.first(); att; att=attlist.next()) {
274 Event *event = new Event(*ev); 274 Event *event = new Event(*ev);
275 mOutgoing->addMessage(event,Scheduler::Request,att->email()); 275 mOutgoing->addMessage(event,Scheduler::Request,att->email());
276 delete(event); 276 delete(event);
277 } 277 }
278 mScheduler->deleteTransaction(item->event()); 278 mScheduler->deleteTransaction(item->event());
279 delete item; 279 delete item;
280 emit numMessagesChanged(mMessageListView->childCount()); 280 emit numMessagesChanged(mMessageListView->childCount());
281 return true; 281 return true;
282 } 282 }
283 mScheduler->deleteTransaction(item->event()); 283 mScheduler->deleteTransaction(item->event());
284 delete item; 284 delete item;
285 emit numMessagesChanged(mMessageListView->childCount()); 285 emit numMessagesChanged(mMessageListView->childCount());
286 return false; 286 return false;
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);
300 eventViewer->addText(i18n("counter proposal event","<b>Counter-event:</b><p>")); 300 eventViewer->addText(i18n("counter proposal event","<b>Counter-event:</b><p>"));
301 eventViewer->addEvent(counterEvent); 301 eventViewer->addEvent(counterEvent);
302 eventViewer->addText("<hr>"); 302 eventViewer->addText("<hr>");
303 eventViewer->addText(i18n("<b>Original event:</b><p>")); 303 eventViewer->addText(i18n("<b>Original event:</b><p>"));
304 if (even) eventViewer->addEvent(even); 304 if (even) eventViewer->addEvent(even);
305 else eventViewer->addText(i18n("A corresponding event is missing in your calendar!")); 305 else eventViewer->addText(i18n("A corresponding event is missing in your calendar!"));
306 eventViewer->addText("<hr>"); 306 eventViewer->addText("<hr>");
307 eventViewer->addText(i18n("If this counter-event is a good proposal for your event, press 'Accept'. All Attendees will then get the new version of this event")); 307 eventViewer->addText(i18n("If this counter-event is a good proposal for your event, press 'Accept'. All Attendees will then get the new version of this event"));
308 eventViewer->show(); 308 eventViewer->show();
309 309
310 eventViewer->exec(); 310 eventViewer->exec();
311 if (eventViewer->result()) { 311 if (eventViewer->result()) {
312 kdDebug() << "IncomingDialog::Counter:Accept" << endl; 312 kdDebug() << "IncomingDialog::Counter:Accept" << endl;
313 int revision = 0; 313 int revision = 0;
314 if (even) { 314 if (even) {
315 revision = even->revision(); 315 revision = even->revision();
316 mCalendar->deleteEvent(even); 316 mCalendar->deleteEvent(even);
317 } 317 }
@@ -347,146 +347,146 @@ bool IncomingDialog::incomeCounter(ScheduleItemIn *item)
347 delete item; 347 delete item;
348 emit numMessagesChanged(mMessageListView->childCount()); 348 emit numMessagesChanged(mMessageListView->childCount());
349 return false; 349 return false;
350} 350}
351 351
352bool IncomingDialog::incomeDeclineCounter(ScheduleItemIn *item) 352bool IncomingDialog::incomeDeclineCounter(ScheduleItemIn *item)
353{ 353{
354 Event *even = mCalendar->event(item->event()->uid()); 354 Event *even = mCalendar->event(item->event()->uid());
355 if (even) { 355 if (even) {
356 mOutgoing->addMessage(even,Scheduler::Refresh); 356 mOutgoing->addMessage(even,Scheduler::Refresh);
357 mScheduler->deleteTransaction(item->event()); 357 mScheduler->deleteTransaction(item->event());
358 delete item; 358 delete item;
359 emit numMessagesChanged(mMessageListView->childCount()); 359 emit numMessagesChanged(mMessageListView->childCount());
360 return true; 360 return true;
361 } 361 }
362 mScheduler->deleteTransaction(item->event()); 362 mScheduler->deleteTransaction(item->event());
363 delete item; 363 delete item;
364 emit numMessagesChanged(mMessageListView->childCount()); 364 emit numMessagesChanged(mMessageListView->childCount());
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;
378 } 378 }
379 else { 379 else {
380 kdDebug() << "IncomingDialog::incomeAdd - only Events are supportet yet" << endl; 380 kdDebug() << "IncomingDialog::incomeAdd - only Events are supportet yet" << endl;
381 mScheduler->deleteTransaction( incidence ); 381 mScheduler->deleteTransaction( incidence );
382 delete item; 382 delete item;
383 emit numMessagesChanged(mMessageListView->childCount()); 383 emit numMessagesChanged(mMessageListView->childCount());
384 return false; 384 return false;
385 } 385 }
386} 386}
387 387
388bool IncomingDialog::incomeDefault(ScheduleItemIn *item) 388bool IncomingDialog::incomeDefault(ScheduleItemIn *item)
389{ 389{
390 if (mScheduler->acceptTransaction(item->event(),item->method(),item->status())) { 390 if (mScheduler->acceptTransaction(item->event(),item->method(),item->status())) {
391 delete item; 391 delete item;
392 emit numMessagesChanged(mMessageListView->childCount()); 392 emit numMessagesChanged(mMessageListView->childCount());
393 return true; 393 return true;
394 } 394 }
395 else { 395 else {
396 KMessageBox::error(this,i18n("Unable to accept the IMIP-message. It may be a problem with the email addresses.")); 396 KMessageBox::error(this,i18n("Unable to accept the IMIP-message. It may be a problem with the email addresses."));
397 kdDebug() << "IncomingDialog::acceptMessage(): Error!" << endl; 397 kdDebug() << "IncomingDialog::acceptMessage(): Error!" << endl;
398 return false; 398 return false;
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);
412 freebusy->setOrganizer(inc->organizer()); 412 freebusy->setOrganizer(inc->organizer());
413 Attendee *att = new Attendee(KOPrefs::instance()->fullName(), 413 Attendee *att = new Attendee(KOPrefs::instance()->fullName(),
414 KOPrefs::instance()->email()); 414 KOPrefs::instance()->email());
415 freebusy->addAttendee(att); 415 freebusy->addAttendee(att);
416 416
417 kdDebug() << "calendarview: schedule_publish_freebusy: startDate: " 417 kdDebug() << "calendarview: schedule_publish_freebusy: startDate: "
418 << KGlobal::locale()->formatDateTime( start ) << " End Date: " 418 << KGlobal::locale()->formatDateTime( start ) << " End Date: "
419 << KGlobal::locale()->formatDateTime( end ) << endl; 419 << KGlobal::locale()->formatDateTime( end ) << endl;
420 420
421 if (mOutgoing->addMessage(freebusy,Scheduler::Reply)) { 421 if (mOutgoing->addMessage(freebusy,Scheduler::Reply)) {
422 delete item; 422 delete item;
423 emit numMessagesChanged(mMessageListView->childCount()); 423 emit numMessagesChanged(mMessageListView->childCount());
424 delete(freebusy); 424 delete(freebusy);
425 return true; 425 return true;
426 } 426 }
427 return false; 427 return false;
428 } else { 428 } else {
429 return incomeDefault(item); 429 return incomeDefault(item);
430 } 430 }
431 return false; 431 return false;
432} 432}
433 433
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 }
447 } else return false; 447 } else return false;
448 } else { 448 } else {
449 449
450 if ( method==Scheduler::Reply ) { 450 if ( method==Scheduler::Reply ) {
451 if ( KOPrefs::instance()->mIMIPAutoFreeBusy==KOPrefs::addressbookAuto ) { 451 if ( KOPrefs::instance()->mIMIPAutoFreeBusy==KOPrefs::addressbookAuto ) {
452 // insert freebusy information 452 // insert freebusy information
453 //if ( checkAttendeesInAddressbook(inc) ) 453 //if ( checkAttendeesInAddressbook(inc) )
454 454
455 } else return false; 455 } else return false;
456 } else { 456 } else {
457 if ( method==Scheduler::Publish) { 457 if ( method==Scheduler::Publish) {
458 if ( KOPrefs::instance()->mIMIPAutoFreeBusy==KOPrefs::addressbookAuto ) { 458 if ( KOPrefs::instance()->mIMIPAutoFreeBusy==KOPrefs::addressbookAuto ) {
459 // insert freebusy information 459 // insert freebusy information
460 //if ( checkOrganizerInAddressbook(inc->organizer()) ) 460 //if ( checkOrganizerInAddressbook(inc->organizer()) )
461 461
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;
475 } else { 475 } else {
476 476
477 if ( method==Scheduler::Reply ) { 477 if ( method==Scheduler::Reply ) {
478 if ( KOPrefs::instance()->mIMIPAutoInsertReply==KOPrefs::addressbookAuto ) { 478 if ( KOPrefs::instance()->mIMIPAutoInsertReply==KOPrefs::addressbookAuto ) {
479 // update event information 479 // update event information
480 if ( checkAttendeesInAddressbook(inc) ) 480 if ( checkAttendeesInAddressbook(inc) )
481 autoAction = acceptMessage(item); 481 autoAction = acceptMessage(item);
482 } else return false; 482 } else return false;
483 } else { 483 } else {
484 484
485 if ( method==Scheduler::Refresh ) { 485 if ( method==Scheduler::Refresh ) {
486 if ( KOPrefs::instance()->mIMIPAutoRefresh==KOPrefs::addressbookAuto ) { 486 if ( KOPrefs::instance()->mIMIPAutoRefresh==KOPrefs::addressbookAuto ) {
487 // send refresh-information 487 // send refresh-information
488 if ( checkAttendeesInAddressbook(inc) ) 488 if ( checkAttendeesInAddressbook(inc) )
489 autoAction = acceptMessage(item); 489 autoAction = acceptMessage(item);
490 else return false; 490 else return false;
491 } else return false; 491 } else return false;
492 } else return false; 492 } 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
@@ -560,49 +560,49 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
560 connect( mAgenda, SIGNAL( resizedSignal() ), 560 connect( mAgenda, SIGNAL( resizedSignal() ),
561 SLOT( updateConfig( ) ) ); 561 SLOT( updateConfig( ) ) );
562 connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ), 562 connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ),
563 SLOT( addToCalSlot(Incidence *, Incidence * ) ) ); 563 SLOT( addToCalSlot(Incidence *, Incidence * ) ) );
564 connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ), 564 connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ),
565 SLOT( addToCalSlot(Incidence * , Incidence *) ) ); 565 SLOT( addToCalSlot(Incidence * , Incidence *) ) );
566 // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); 566 // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) );
567 //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); 567 //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) );
568 568
569 connect( mAllDayAgenda, SIGNAL( signalClearSelection() ),mAgenda, SLOT( slotClearSelection()) ); 569 connect( mAllDayAgenda, SIGNAL( signalClearSelection() ),mAgenda, SLOT( slotClearSelection()) );
570 connect( mAgenda, SIGNAL( signalClearSelection() ),mAllDayAgenda, SLOT( slotClearSelection()) ); 570 connect( mAgenda, SIGNAL( signalClearSelection() ),mAllDayAgenda, SLOT( slotClearSelection()) );
571 571
572} 572}
573 573
574void KOAgendaView::toggleAllDay() 574void KOAgendaView::toggleAllDay()
575{ 575{
576 if ( mSplitterAgenda->firstHandle() ) 576 if ( mSplitterAgenda->firstHandle() )
577 mSplitterAgenda->firstHandle()->toggle(); 577 mSplitterAgenda->firstHandle()->toggle();
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}
591 591
592KOAgendaView::~KOAgendaView() 592KOAgendaView::~KOAgendaView()
593{ 593{
594 delete mAllAgendaPopup; 594 delete mAllAgendaPopup;
595 //delete mAllDayAgendaPopup; 595 //delete mAllDayAgendaPopup;
596 delete KOAgendaItem::paintPix(); 596 delete KOAgendaItem::paintPix();
597 delete KOAgendaItem::paintPixSel(); 597 delete KOAgendaItem::paintPixSel();
598} 598}
599void KOAgendaView::resizeEvent( QResizeEvent* e ) 599void KOAgendaView::resizeEvent( QResizeEvent* e )
600{ 600{
601 //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width()); 601 //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width());
602 bool uc = false; 602 bool uc = false;
603 int ow = e->oldSize().width(); 603 int ow = e->oldSize().width();
604 int oh = e->oldSize().height(); 604 int oh = e->oldSize().height();
605 int w = e->size().width(); 605 int w = e->size().width();
606 int h = e->size().height(); 606 int h = e->size().height();
607 if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) { 607 if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) {
608 if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda ) 608 if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda )
@@ -946,120 +946,120 @@ void KOAgendaView::updateConfig()
946 mAgenda->restorePosition(); 946 mAgenda->restorePosition();
947} 947}
948 948
949 949
950void KOAgendaView::updateEventDates(KOAgendaItem *item, int type) 950void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
951{ 951{
952 952
953 953
954 int xxx = item->cellX(); 954 int xxx = item->cellX();
955 //qDebug("KOAgendaView::updateEventDates %d %d %d %d %d", xxx, mMinY.at(xxx),mMaxY.at(xxx),item->cellYTop(),item->cellYBottom() ); 955 //qDebug("KOAgendaView::updateEventDates %d %d %d %d %d", xxx, mMinY.at(xxx),mMaxY.at(xxx),item->cellYTop(),item->cellYBottom() );
956 if ( mMinY.at(xxx) > item->cellYTop() ) 956 if ( mMinY.at(xxx) > item->cellYTop() )
957 mMinY.at(xxx) = item->cellYTop(); 957 mMinY.at(xxx) = item->cellYTop();
958 if ( mMaxY.at(xxx) < item->cellYBottom() ) 958 if ( mMaxY.at(xxx) < item->cellYBottom() )
959 mMaxY.at(xxx) = item->cellYBottom(); 959 mMaxY.at(xxx) = item->cellYBottom();
960 960
961 QDateTime startDt,endDt; 961 QDateTime startDt,endDt;
962 QDate startDate; 962 QDate startDate;
963 int lenInSecs; 963 int lenInSecs;
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()];
985 } 985 }
986 } 986 }
987 startDt.setDate(startDate); 987 startDt.setDate(startDate);
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));
1001 endDt.setDate(startDate. 1001 endDt.setDate(startDate.
1002 addDays(item->lastMultiItem()->cellX() - item->cellX())); 1002 addDays(item->lastMultiItem()->cellX() - item->cellX()));
1003 } else { 1003 } else {
1004 endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); 1004 endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1));
1005 endDt.setDate(startDate); 1005 endDt.setDate(startDate);
1006 } 1006 }
1007 } 1007 }
1008 } else { 1008 } else {
1009 // todo 1009 // todo
1010 if (item->lastMultiItem()) { 1010 if (item->lastMultiItem()) {
1011 endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); 1011 endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1));
1012 endDt.setDate(startDate. 1012 endDt.setDate(startDate.
1013 addDays(item->lastMultiItem()->cellX() - item->cellX())); 1013 addDays(item->lastMultiItem()->cellX() - item->cellX()));
1014 } else { 1014 } else {
1015 //qDebug("tem->cellYBottom() %d",item->cellYBottom() ); 1015 //qDebug("tem->cellYBottom() %d",item->cellYBottom() );
1016 if ( item->cellYBottom() > 0 ) 1016 if ( item->cellYBottom() > 0 )
1017 endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); 1017 endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1));
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 ));
1034 } 1034 }
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();
1048} 1048}
1049 1049
1050void KOAgendaView::showDates( const QDate &start, const QDate &end ) 1050void KOAgendaView::showDates( const QDate &start, const QDate &end )
1051{ 1051{
1052 // kdDebug() << "KOAgendaView::selectDates" << endl; 1052 // kdDebug() << "KOAgendaView::selectDates" << endl;
1053 1053
1054 mSelectedDates.clear(); 1054 mSelectedDates.clear();
1055 // qDebug("KOAgendaView::showDates "); 1055 // qDebug("KOAgendaView::showDates ");
1056 QDate d = start; 1056 QDate d = start;
1057 while (d <= end) { 1057 while (d <= end) {
1058 mSelectedDates.append(d); 1058 mSelectedDates.append(d);
1059 d = d.addDays( 1 ); 1059 d = d.addDays( 1 );
1060 } 1060 }
1061 1061
1062 // and update the view 1062 // and update the view
1063 fillAgenda(); 1063 fillAgenda();
1064} 1064}
1065 1065
diff --git a/korganizer/koeditorrecurrence.cpp b/korganizer/koeditorrecurrence.cpp
index e165017..dea8981 100644
--- a/korganizer/koeditorrecurrence.cpp
+++ b/korganizer/koeditorrecurrence.cpp
@@ -850,49 +850,49 @@ void KOEditorRecurrence::setDefaults( QDateTime from, QDateTime to, bool )
850 mRecurrenceRange->setDefaults( to ); 850 mRecurrenceRange->setDefaults( to );
851 851
852 mRecurrenceChooser->setType( RecurrenceChooser::Weekly ); 852 mRecurrenceChooser->setType( RecurrenceChooser::Weekly );
853 showCurrentRule( mRecurrenceChooser->type() ); 853 showCurrentRule( mRecurrenceChooser->type() );
854 854
855 mDaily->setFrequency( 1 ); 855 mDaily->setFrequency( 1 );
856 856
857 mWeekly->setFrequency( 1 ); 857 mWeekly->setFrequency( 1 );
858 QBitArray days( 7 ); 858 QBitArray days( 7 );
859 days.fill( 0 ); 859 days.fill( 0 );
860 days.setBit( from.date().dayOfWeek()- 1); 860 days.setBit( from.date().dayOfWeek()- 1);
861 mWeekly->setDays( days ); 861 mWeekly->setDays( days );
862 mMonthly->setFrequency( 1 ); 862 mMonthly->setFrequency( 1 );
863 mMonthly->setByPos((from.date().day()/7), from.date().dayOfWeek()-1 ); 863 mMonthly->setByPos((from.date().day()/7), from.date().dayOfWeek()-1 );
864 mMonthly->setByDay( from.date().day()-1 ); 864 mMonthly->setByDay( from.date().day()-1 );
865 mYearly->setFrequency( 1 ); 865 mYearly->setFrequency( 1 );
866 mYearly->setByDay( from.date().dayOfYear() ); 866 mYearly->setByDay( from.date().dayOfYear() );
867 mYearly->setByMonth( from.date().month(), from.date().day() ); 867 mYearly->setByMonth( from.date().month(), from.date().day() );
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 );
881 QPtrList<Recurrence::rMonthPos> rmp; 881 QPtrList<Recurrence::rMonthPos> rmp;
882 QPtrList<int> rmd; 882 QPtrList<int> rmd;
883 int day = 0; 883 int day = 0;
884 int count = 0; 884 int count = 0;
885 int month = 0; 885 int month = 0;
886 setDateTimes( event->dtStart(), dtEnd ); 886 setDateTimes( event->dtStart(), dtEnd );
887 887
888 Recurrence *r = event->recurrence(); 888 Recurrence *r = event->recurrence();
889 int f = r->frequency(); 889 int f = r->frequency();
890 890
891 int recurs = r->doesRecur(); 891 int recurs = r->doesRecur();
892 892
893 mEnabledCheck->setChecked( recurs ); 893 mEnabledCheck->setChecked( recurs );
894 setEnabled( recurs ); 894 setEnabled( recurs );
895 895
896 int recurrenceType = RecurrenceChooser::Weekly; 896 int recurrenceType = RecurrenceChooser::Weekly;
897 897
898 switch ( recurs ) { 898 switch ( recurs ) {
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index e5ff8af..02f13c7 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -127,62 +127,62 @@ int KOEventViewerDialog::executeS( bool local )
127 findButton( User1 )->setFocus(); 127 findButton( User1 )->setFocus();
128 else 128 else
129 findButton( Ok )->setFocus(); 129 findButton( Ok )->setFocus();
130 exec(); 130 exec();
131 return mSyncResult; 131 return mSyncResult;
132} 132}
133 133
134void KOEventViewerDialog::updateConfig() 134void KOEventViewerDialog::updateConfig()
135{ 135{
136 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); 136 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont );
137 137
138} 138}
139void KOEventViewerDialog::setEvent(Event *event) 139void KOEventViewerDialog::setEvent(Event *event)
140{ 140{
141 mEventViewer->setEvent(event); 141 mEventViewer->setEvent(event);
142 mIncidence = event; 142 mIncidence = event;
143 mEventViewer->setFocus(); 143 mEventViewer->setFocus();
144 //findButton( Close )->setFocus(); 144 //findButton( Close )->setFocus();
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}
171 171
172void KOEventViewerDialog::addEvent(Event *event) 172void KOEventViewerDialog::addEvent(Event *event)
173{ 173{
174 mEventViewer->addEvent(event); 174 mEventViewer->addEvent(event);
175 mIncidence = event; 175 mIncidence = event;
176 mEventViewer->setFocus(); 176 mEventViewer->setFocus();
177 //findButton( Close )->setFocus(); 177 //findButton( Close )->setFocus();
178 if ( !mSyncMode ) { 178 if ( !mSyncMode ) {
179 findButton( User1 )->setText( i18n("Agenda")); 179 findButton( User1 )->setText( i18n("Agenda"));
180 } 180 }
181} 181}
182 182
183void KOEventViewerDialog::setTodo(Todo *event) 183void KOEventViewerDialog::setTodo(Todo *event)
184{ 184{
185 mEventViewer->setTodo(event); 185 mEventViewer->setTodo(event);
186 mIncidence = (Incidence*)event; 186 mIncidence = (Incidence*)event;
187 mEventViewer->setFocus(); 187 mEventViewer->setFocus();
188 //findButton( Close )->setFocus(); 188 //findButton( Close )->setFocus();
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 678cab6..c868270 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -361,49 +361,49 @@ void MonthViewItem::paint(QPainter *p)
361 pa.setPoint (2, x+sizeM/2, yyy-sizeM/2 ); 361 pa.setPoint (2, x+sizeM/2, yyy-sizeM/2 );
362 p->drawPolygon( pa ); 362 p->drawPolygon( pa );
363 } 363 }
364 if ( mMultiday == 2 || mMultiday == 1 ) { 364 if ( mMultiday == 2 || mMultiday == 1 ) {
365 QPointArray pa ( 3 ); 365 QPointArray pa ( 3 );
366 pa.setPoint (0, x+sizeM +sizeM/2, yyy ); 366 pa.setPoint (0, x+sizeM +sizeM/2, yyy );
367 pa.setPoint (1, x+sizeM, yyy+sizeM/2 ); 367 pa.setPoint (1, x+sizeM, yyy+sizeM/2 );
368 pa.setPoint (2, x+sizeM, yyy-sizeM/2 ); 368 pa.setPoint (2, x+sizeM, yyy-sizeM/2 );
369 p->drawPolygon( pa ); 369 p->drawPolygon( pa );
370 } 370 }
371 if ( mMultiday == 1 ) { 371 if ( mMultiday == 1 ) {
372 // p->fillRect ( x, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) ); 372 // p->fillRect ( x, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) );
373 373
374 p->drawLine ( x+1, yyy-sizeM/2, x+1, yyy+sizeM/2 ); 374 p->drawLine ( x+1, yyy-sizeM/2, x+1, yyy+sizeM/2 );
375 } 375 }
376 if ( mMultiday == 3 ) { 376 if ( mMultiday == 3 ) {
377 // p->fillRect ( x+sizeM, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) ); 377 // p->fillRect ( x+sizeM, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) );
378 p->drawLine ( x+sizeM +sizeM/2-1, yyy-sizeM/2, x+sizeM +sizeM/2-1, yyy+sizeM/2 ); 378 p->drawLine ( x+sizeM +sizeM/2-1, yyy-sizeM/2, x+sizeM +sizeM/2-1, yyy+sizeM/2 );
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;
392 392
393 } else { 393 } else {
394 int val = td->percentComplete()/20; 394 int val = td->percentComplete()/20;
395 p->fillRect ( x+1, y-2, val ,size+4,Qt::black ); 395 p->fillRect ( x+1, y-2, val ,size+4,Qt::black );
396 p->drawRect ( x, y-2,7,size+4); 396 p->drawRect ( x, y-2,7,size+4);
397 x += size + 3; 397 x += size + 3;
398 } 398 }
399 } 399 }
400 QFontMetrics fm = p->fontMetrics(); 400 QFontMetrics fm = p->fontMetrics();
401 int yPos; 401 int yPos;
402 int pmheight = size; 402 int pmheight = size;
403 if( pmheight < fm.height() ) 403 if( pmheight < fm.height() )
404 yPos = fm.ascent() + fm.leading()/2; 404 yPos = fm.ascent() + fm.leading()/2;
405 else 405 else
406 yPos = pmheight/2 - fm.height()/2 + fm.ascent(); 406 yPos = pmheight/2 - fm.height()/2 + fm.ascent();
407 p->setPen( palette().color( QPalette::Normal, sel ? \ 407 p->setPen( palette().color( QPalette::Normal, sel ? \
408 QColorGroup::HighlightedText : QColorGroup::Foreground ) ); 408 QColorGroup::HighlightedText : QColorGroup::Foreground ) );
409 if ( KOPrefs::instance()->mMonthShowTimes || isWeekItem) { 409 if ( KOPrefs::instance()->mMonthShowTimes || isWeekItem) {
@@ -1922,49 +1922,49 @@ void KOMonthView::computeLayout()
1922 if ( i == (6-rowModulo)) 1922 if ( i == (6-rowModulo))
1923 ++h; 1923 ++h;
1924 mWeekLabels[i]->setGeometry( 0,y,weeklabelwid,h); 1924 mWeekLabels[i]->setGeometry( 0,y,weeklabelwid,h);
1925 y += h; 1925 y += h;
1926 } 1926 }
1927 mWeekLabels[6]->setGeometry( 0,0,weeklabelwid,dayLabelHei); 1927 mWeekLabels[6]->setGeometry( 0,0,weeklabelwid,dayLabelHei);
1928 // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height()); 1928 // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height());
1929 //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); 1929 //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height());
1930 mShortDayLabelsM = mDayLabels[0]->width()-2 < mWidthLongDayLabel ; 1930 mShortDayLabelsM = mDayLabels[0]->width()-2 < mWidthLongDayLabel ;
1931 updateDayLabels(); 1931 updateDayLabels();
1932 //bool forceUpdate = !updatePossible; 1932 //bool forceUpdate = !updatePossible;
1933 updatePossible = true; 1933 updatePossible = true;
1934 //mWeekLabels[mNumWeeks]->setText( i18n("W")); 1934 //mWeekLabels[mNumWeeks]->setText( i18n("W"));
1935} 1935}
1936 1936
1937void KOMonthView::showContextMenu( Incidence *incidence ) 1937void KOMonthView::showContextMenu( Incidence *incidence )
1938{ 1938{
1939 if( incidence ) 1939 if( 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 */
1953} 1953}
1954MonthViewCell * KOMonthView::selectedCell( ) 1954MonthViewCell * KOMonthView::selectedCell( )
1955{ 1955{
1956 return mSelectedCell; 1956 return mSelectedCell;
1957} 1957}
1958void KOMonthView::setSelectedCell( MonthViewCell *cell ) 1958void KOMonthView::setSelectedCell( MonthViewCell *cell )
1959{ 1959{
1960 //qDebug("KOMonthView::setSelectedCell %d", cell); 1960 //qDebug("KOMonthView::setSelectedCell %d", cell);
1961 if ( mSelectedCell && mSelectedCell != cell ) { 1961 if ( mSelectedCell && mSelectedCell != cell ) {
1962 MonthViewCell * mvc = mSelectedCell; 1962 MonthViewCell * mvc = mSelectedCell;
1963 mSelectedCell = cell; 1963 mSelectedCell = cell;
1964 mvc->deselect(); 1964 mvc->deselect();
1965 } else 1965 } else
1966 mSelectedCell = cell; 1966 mSelectedCell = cell;
1967 // if ( mSelectedCell ) 1967 // if ( mSelectedCell )
1968 // mSelectedCell->select(); 1968 // mSelectedCell->select();
1969 if ( !mSelectedCell ) 1969 if ( !mSelectedCell )
1970 emit incidenceSelected( 0 ); 1970 emit incidenceSelected( 0 );
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 @@
34#include <libkcal/dummyscheduler.h> 34#include <libkcal/dummyscheduler.h>
35#include <libkcal/icalformat.h> 35#include <libkcal/icalformat.h>
36#include <libkcal/calendar.h> 36#include <libkcal/calendar.h>
37 37
38#ifndef KORG_NOMAIL 38#ifndef KORG_NOMAIL
39#include "mailscheduler.h" 39#include "mailscheduler.h"
40#endif 40#endif
41 41
42#include "koprefs.h" 42#include "koprefs.h"
43#include "outgoingdialog.h" 43#include "outgoingdialog.h"
44#include "koeventviewerdialog.h" 44#include "koeventviewerdialog.h"
45#include "docprefs.h" 45#include "docprefs.h"
46 46
47ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev, 47ScheduleItemOut::ScheduleItemOut(QListView *parent,IncidenceBase *ev,
48 Scheduler::Method method, 48 Scheduler::Method method,
49 const QString &recipients) 49 const QString &recipients)
50 : QListViewItem(parent) 50 : QListViewItem(parent)
51{ 51{
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"));
74 } else { //If it does not float 74 } else { //If it does not float
75 setText(2,event->dtStartTimeStr()); 75 setText(2,event->dtStartTimeStr());
76 if (event->hasDuration()) { 76 if (event->hasDuration()) {
77 setText(4,event->dtEndTimeStr()); 77 setText(4,event->dtEndTimeStr());
78 } else { 78 } else {
79 setText(4,i18n("no time")); 79 setText(4,i18n("no time"));
80 } 80 }
81 } 81 }
82 if (event->hasEndDate()) { 82 if (event->hasEndDate()) {
83 setText(3,event->dtEndDateStr()); 83 setText(3,event->dtEndDateStr());
84 } 84 }
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 }
98 } 98 }
99 if (event->hasDueDate()) { 99 if (event->hasDueDate()) {
100 setText(3,event->dtDueDateStr()); 100 setText(3,event->dtDueDateStr());
101 if (!event->doesFloat()) { 101 if (!event->doesFloat()) {
102 setText(4,event->dtDueTimeStr()); 102 setText(4,event->dtDueTimeStr());
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() ) );
116 setText(4,KGlobal::locale()->formatTime( freebusy->dtEnd().time() ) ); 116 setText(4,KGlobal::locale()->formatTime( freebusy->dtEnd().time() ) );
117 } 117 }
118 118
119// kdDebug() << "ScheduleItemOut: Setting the method" << endl; 119// kdDebug() << "ScheduleItemOut: Setting the method" << endl;
120 //Set the Method 120 //Set the Method
121 setText(5,Scheduler::translatedMethodName(mMethod)); 121 setText(5,Scheduler::translatedMethodName(mMethod));
122} 122}
123 123
124OutgoingDialog::OutgoingDialog(Calendar *calendar,QWidget* parent, 124OutgoingDialog::OutgoingDialog(Calendar *calendar,QWidget* parent,
125 const char* name,bool modal, 125 const char* name,bool modal,
126 WFlags fl) 126 WFlags fl)
127 : OutgoingDialog_base(parent,name,modal,fl) 127 : OutgoingDialog_base(parent,name,modal,fl)
128{ 128{
129 mCalendar = calendar; 129 mCalendar = calendar;
130 130
131 mFormat = new ICalFormat; 131 mFormat = new ICalFormat;
132 132
133 if (KOPrefs::instance()->mIMIPScheduler == KOPrefs::IMIPDummy ) { 133 if (KOPrefs::instance()->mIMIPScheduler == KOPrefs::IMIPDummy ) {
@@ -220,52 +220,52 @@ void OutgoingDialog::send()
220 delete (oldItem->event()); 220 delete (oldItem->event());
221 delete oldItem; 221 delete oldItem;
222 } 222 }
223 } 223 }
224 224
225 emit numMessagesChanged(mMessageListView->childCount()); 225 emit numMessagesChanged(mMessageListView->childCount());
226} 226}
227 227
228void OutgoingDialog::deleteItem() 228void OutgoingDialog::deleteItem()
229{ 229{
230 ScheduleItemOut *item = (ScheduleItemOut *)(mMessageListView->selectedItem()); 230 ScheduleItemOut *item = (ScheduleItemOut *)(mMessageListView->selectedItem());
231 if(!item) 231 if(!item)
232 return; 232 return;
233 deleteMessage(item->event()); 233 deleteMessage(item->event());
234 delete(item->event()); 234 delete(item->event());
235 mMessageListView->takeItem(item); 235 mMessageListView->takeItem(item);
236 emit numMessagesChanged(mMessageListView->childCount()); 236 emit numMessagesChanged(mMessageListView->childCount());
237} 237}
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);
254 if (todo) eventViewer->setTodo(todo); 254 if (todo) eventViewer->setTodo(todo);
255 sendText = "<hr><h4>"+i18n("Event will be sent to:")+"</h4>"; 255 sendText = "<hr><h4>"+i18n("Event will be sent to:")+"</h4>";
256 switch (item->method()) { 256 switch (item->method()) {
257 case Scheduler::Publish: { 257 case Scheduler::Publish: {
258 sendText += item->recipients(); 258 sendText += item->recipients();
259 break; } 259 break; }
260 case Scheduler::Request: { 260 case Scheduler::Request: {
261 sendText += i18n("All attendees"); 261 sendText += i18n("All attendees");
262 break; } 262 break; }
263 case Scheduler::Refresh: { 263 case Scheduler::Refresh: {
264 sendText += i18n("All attendees"); 264 sendText += i18n("All attendees");
265 break; } 265 break; }
266 case Scheduler::Cancel: { 266 case Scheduler::Cancel: {
267 sendText += i18n("All attendees"); 267 sendText += i18n("All attendees");
268 break; } 268 break; }
269 case Scheduler::Add: { 269 case Scheduler::Add: {
270 sendText += i18n("All attendees"); 270 sendText += i18n("All attendees");
271 break; } 271 break; }
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp
index 6de1566..0afa0a7 100644
--- a/libkcal/alarm.cpp
+++ b/libkcal/alarm.cpp
@@ -317,92 +317,92 @@ void Alarm::setDisplayAlarm(const QString &text)
317 317
318void Alarm::setText(const QString &text) 318void Alarm::setText(const QString &text)
319{ 319{
320 if (mType == Display) { 320 if (mType == Display) {
321 mDescription = text; 321 mDescription = text;
322 mParent->updated(); 322 mParent->updated();
323 } 323 }
324} 324}
325 325
326QString Alarm::text() const 326QString Alarm::text() const
327{ 327{
328 return (mType == Display) ? mDescription : QString::null; 328 return (mType == Display) ? mDescription : QString::null;
329} 329}
330 330
331void Alarm::setTime(const QDateTime &alarmTime) 331void Alarm::setTime(const QDateTime &alarmTime)
332{ 332{
333 mAlarmTime = alarmTime; 333 mAlarmTime = alarmTime;
334 mHasTime = true; 334 mHasTime = true;
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
348 { 348 {
349 return mOffset.asSeconds(); 349 return mOffset.asSeconds();
350 } 350 }
351 351
352} 352}
353QString Alarm::offsetText() 353QString Alarm::offsetText()
354{ 354{
355 int min = -offset()/60; 355 int min = -offset()/60;
356 int hours = min /60; 356 int hours = min /60;
357 min = min % 60; 357 min = min % 60;
358 int days = hours /24; 358 int days = hours /24;
359 hours = hours % 24; 359 hours = hours % 24;
360 QString message; 360 QString message;
361 //qDebug("%d %d %d ", days, hours, min ); 361 //qDebug("%d %d %d ", days, hours, min );
362 if ( days > 0 ) 362 if ( days > 0 )
363 message += i18n("%1d").arg( days ); 363 message += i18n("%1d").arg( days );
364 if ( hours > 0 ) { 364 if ( hours > 0 ) {
365 if ( !message.isEmpty() ) message += "/"; 365 if ( !message.isEmpty() ) message += "/";
366 message += i18n("%1h").arg( hours ); 366 message += i18n("%1h").arg( hours );
367 } 367 }
368 if ( min > 0 ) { 368 if ( min > 0 ) {
369 if ( !message.isEmpty() ) message += "/"; 369 if ( !message.isEmpty() ) message += "/";
370 message += i18n("%1min").arg( min ); 370 message += i18n("%1min").arg( min );
371 } 371 }
372 if ( message.isEmpty() ) 372 if ( message.isEmpty() )
373 message = i18n("%1min").arg( 0 ); 373 message = i18n("%1min").arg( 0 );
374 return message; 374 return message;
375} 375}
376 376
377 377
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() );
391 } 391 }
392 } 392 }
393} 393}
394 394
395bool Alarm::hasTime() const 395bool Alarm::hasTime() const
396{ 396{
397 return mHasTime; 397 return mHasTime;
398} 398}
399 399
400void Alarm::setSnoozeTime(int alarmSnoozeTime) 400void Alarm::setSnoozeTime(int alarmSnoozeTime)
401{ 401{
402 mAlarmSnoozeTime = alarmSnoozeTime; 402 mAlarmSnoozeTime = alarmSnoozeTime;
403 mParent->updated(); 403 mParent->updated();
404} 404}
405 405
406int Alarm::snoozeTime() const 406int Alarm::snoozeTime() const
407{ 407{
408 return mAlarmSnoozeTime; 408 return mAlarmSnoozeTime;