summaryrefslogtreecommitdiffabout
path: root/korganizer/kodaymatrix.cpp
Unidiff
Diffstat (limited to 'korganizer/kodaymatrix.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index ecca374..17a1d13 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -452,97 +452,96 @@ void KODayMatrix::updateViewTimed()
452 if ( st >= 0 ) { // start before timeend 452 if ( st >= 0 ) { // start before timeend
453 int end = mStartDate.daysTo( event->dtEnd().date() ); 453 int end = mStartDate.daysTo( event->dtEnd().date() );
454 if ( end >= 0 ) { // end after timestart --- got one! 454 if ( end >= 0 ) { // end after timestart --- got one!
455 //normalize 455 //normalize
456 st = timeSpan - st; 456 st = timeSpan - st;
457 if ( st < 0 ) st = 0; 457 if ( st < 0 ) st = 0;
458 if ( end > timeSpan ) end = timeSpan; 458 if ( end > timeSpan ) end = timeSpan;
459 int iii; 459 int iii;
460 for ( iii = st;iii<= end;++iii) 460 for ( iii = st;iii<= end;++iii)
461 computeEvent( event, iii ); 461 computeEvent( event, iii );
462 } 462 }
463 } 463 }
464 } 464 }
465 } 465 }
466 int startDay = days[0].dayOfWeek(); // 1...7 7 = sunday 466 int startDay = days[0].dayOfWeek(); // 1...7 7 = sunday
467 for(i = 0; i < NUMDAYS; i++) { 467 for(i = 0; i < NUMDAYS; i++) {
468 if ( ( (i+startDay) % 7 == 0 ) ) { 468 if ( ( (i+startDay) % 7 == 0 ) ) {
469 pDays.setBit(i); 469 pDays.setBit(i);
470 } 470 }
471 } 471 }
472 472
473#if 0 473#if 0
474 // insert due todos 474 // insert due todos
475 QPtrList<Todo> todos = calendar()->todos( ); 475 QPtrList<Todo> todos = calendar()->todos( );
476 Todo *todo; 476 Todo *todo;
477 for(todo = todos.first(); todo; todo = todos.next()) { 477 for(todo = todos.first(); todo; todo = todos.next()) {
478 //insertTodo( todo ); 478 //insertTodo( todo );
479 if ( todo->hasDueDate() ) { 479 if ( todo->hasDueDate() ) {
480 int day = mStartDate.daysTo( todo->dtDue().date() ); 480 int day = mStartDate.daysTo( todo->dtDue().date() );
481 if ( day >= 0 && day < timeSpan + 1) { 481 if ( day >= 0 && day < timeSpan + 1) {
482 (*cells)[day]->insertTodo( todo ); 482 (*cells)[day]->insertTodo( todo );
483 } 483 }
484 } 484 }
485 } 485 }
486#endif 486#endif
487 487
488#else 488#else
489 //qDebug("KODayMatrix::updateViewTimed "); 489 //qDebug("KODayMatrix::updateViewTimed ");
490 for(int i = 0; i < NUMDAYS; i++) { 490 for(int i = 0; i < NUMDAYS; i++) {
491 // if events are set for the day then remember to draw it bold 491 // if events are set for the day then remember to draw it bold
492 QPtrList<Event> eventlist = mCalendar->events(days[i]); 492 QPtrList<Event> eventlist = mCalendar->events(days[i]);
493 Event *event; 493 Event *event;
494 int numEvents = eventlist.count(); 494 int numEvents = eventlist.count();
495 QString holiStr = ""; 495 QString holiStr = "";
496 bDays.clearBit(i); 496 bDays.clearBit(i);
497 hDays.clearBit(i); 497 hDays.clearBit(i);
498 eDays.clearBit(i); 498 eDays.clearBit(i);
499 for(event=eventlist.first();event != 0;event=eventlist.next()) { 499 for(event=eventlist.first();event != 0;event=eventlist.next()) {
500 qDebug("FFFFFFFFFFFFFFFFFFFFFFFFF ");
501 ushort recurType = event->recurrence()->doesRecur(); 500 ushort recurType = event->recurrence()->doesRecur();
502 if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || 501 if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) ||
503 (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { 502 (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) {
504 numEvents--; 503 numEvents--;
505 } 504 }
506 if ( event->isHoliday()) { 505 if ( event->isHoliday()) {
507 hDays.setBit(i); 506 hDays.setBit(i);
508 if ( !holiStr.isEmpty() ) 507 if ( !holiStr.isEmpty() )
509 holiStr += "\n"; 508 holiStr += "\n";
510 holiStr += event->summary(); 509 holiStr += event->summary();
511 if ( !event->location().isEmpty() ) 510 if ( !event->location().isEmpty() )
512 holiStr += " (" + event->location() + ")"; 511 holiStr += " (" + event->location() + ")";
513 } 512 }
514 if ( event->isBirthday()) { 513 if ( event->isBirthday()) {
515 if ( !holiStr.isEmpty() ) 514 if ( !holiStr.isEmpty() )
516 holiStr += "\n"; 515 holiStr += "\n";
517 holiStr += i18n("Birthday") + ": "+event->summary(); 516 holiStr += i18n("Birthday") + ": "+event->summary();
518 if ( !event->location().isEmpty() ) 517 if ( !event->location().isEmpty() )
519 holiStr += " (" + event->location() + ")"; 518 holiStr += " (" + event->location() + ")";
520 bDays.setBit(i); 519 bDays.setBit(i);
521 } 520 }
522 } 521 }
523 if ( numEvents ) 522 if ( numEvents )
524 eDays.setBit(i); 523 eDays.setBit(i);
525 //if it is a holy day then draw it red. Sundays are consider holidays, too 524 //if it is a holy day then draw it red. Sundays are consider holidays, too
526 if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) || 525 if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) ||
527 !holiStr.isEmpty()) { 526 !holiStr.isEmpty()) {
528 mHolidays[i] = holiStr; 527 mHolidays[i] = holiStr;
529 } else { 528 } else {
530 mHolidays[i] = QString::null; 529 mHolidays[i] = QString::null;
531 } 530 }
532 } 531 }
533#endif 532#endif
534 mRedrawNeeded = true; 533 mRedrawNeeded = true;
535 if ( ! mPendingUpdateBeforeRepaint ) 534 if ( ! mPendingUpdateBeforeRepaint )
536 repaint(false); 535 repaint(false);
537} 536}
538void KODayMatrix::updateView(QDate actdate) 537void KODayMatrix::updateView(QDate actdate)
539{ 538{
540 539
541 if ( ! actdate.isValid() ) { 540 if ( ! actdate.isValid() ) {
542 //qDebug("date not valid "); 541 //qDebug("date not valid ");
543 return; 542 return;
544 } 543 }
545 mDayChanged = false; 544 mDayChanged = false;
546 //flag to indicate if the starting day of the matrix has changed by this call 545 //flag to indicate if the starting day of the matrix has changed by this call
547 //mDayChanged = false; 546 //mDayChanged = false;
548 // if a new startdate is to be set then apply Cornelius's calculation 547 // if a new startdate is to be set then apply Cornelius's calculation