author | zautrix <zautrix> | 2005-03-21 13:08:02 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-21 13:08:02 (UTC) |
commit | 098a3c6dd844a880beb2851be53314613c3a038d (patch) (unidiff) | |
tree | bac6a915e906760c48b1756c5b0564b04def0b63 /korganizer/kodaymatrix.cpp | |
parent | ad4ecbb0cbf79f37140041eb9a14e71e6fd393f1 (diff) | |
download | kdepimpi-098a3c6dd844a880beb2851be53314613c3a038d.zip kdepimpi-098a3c6dd844a880beb2851be53314613c3a038d.tar.gz kdepimpi-098a3c6dd844a880beb2851be53314613c3a038d.tar.bz2 |
fixes
-rw-r--r-- | korganizer/kodaymatrix.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 582b2ef..9baff20 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -424,59 +424,59 @@ void KODayMatrix::updateEvents() | |||
424 | if ( !mCalendar ) return; | 424 | if ( !mCalendar ) return; |
425 | 425 | ||
426 | for( int i = 0; i < NUMDAYS; i++ ) { | 426 | for( int i = 0; i < NUMDAYS; i++ ) { |
427 | // if events are set for the day then remember to draw it bold | 427 | // if events are set for the day then remember to draw it bold |
428 | QPtrList<Event> eventlist = mCalendar->events( days[ i ] ); | 428 | QPtrList<Event> eventlist = mCalendar->events( days[ i ] ); |
429 | int numEvents = eventlist.count(); | 429 | int numEvents = eventlist.count(); |
430 | Event *event; | 430 | Event *event; |
431 | for( event = eventlist.first(); event != 0;event=eventlist.next()) { | 431 | for( event = eventlist.first(); event != 0;event=eventlist.next()) { |
432 | ushort recurType = event->doesRecur(); | 432 | ushort recurType = event->doesRecur(); |
433 | 433 | ||
434 | if ( ( recurType == Recurrence::rDaily && | 434 | if ( ( recurType == Recurrence::rDaily && |
435 | !KOPrefs::instance()->mDailyRecur ) || | 435 | !KOPrefs::instance()->mDailyRecur ) || |
436 | ( recurType == Recurrence::rWeekly && | 436 | ( recurType == Recurrence::rWeekly && |
437 | !KOPrefs::instance()->mWeeklyRecur ) ) { | 437 | !KOPrefs::instance()->mWeeklyRecur ) ) { |
438 | numEvents--; | 438 | numEvents--; |
439 | } | 439 | } |
440 | } | 440 | } |
441 | events[ i ] = numEvents; | 441 | events[ i ] = numEvents; |
442 | } | 442 | } |
443 | } | 443 | } |
444 | 444 | ||
445 | const QDate& KODayMatrix::getDate(int offset) | 445 | const QDate& KODayMatrix::getDate(int offset) |
446 | { | 446 | { |
447 | if (offset < 0 || offset > NUMDAYS-1) { | 447 | if (offset < 0 || offset > NUMDAYS-1) { |
448 | qDebug("Wrong offset2 "); | 448 | qDebug("Wrong offset2 %d", offset); |
449 | return days[0]; | 449 | return days[0]; |
450 | } | 450 | } |
451 | return days[offset]; | 451 | return days[offset]; |
452 | } | 452 | } |
453 | 453 | ||
454 | QString KODayMatrix::getHolidayLabel(int offset) | 454 | QString KODayMatrix::getHolidayLabel(int offset) |
455 | { | 455 | { |
456 | if (offset < 0 || offset > NUMDAYS-1) { | 456 | if (offset < 0 || offset > NUMDAYS-1) { |
457 | qDebug("Wrong offset1 "); | 457 | qDebug("Wrong offset1 %d", offset); |
458 | return 0; | 458 | return QString(); |
459 | } | 459 | } |
460 | return mHolidays[offset]; | 460 | return mHolidays[offset]; |
461 | } | 461 | } |
462 | 462 | ||
463 | int KODayMatrix::getDayIndexFrom(int x, int y) | 463 | int KODayMatrix::getDayIndexFrom(int x, int y) |
464 | { | 464 | { |
465 | int colModulo = (width()-2) % 7; | 465 | int colModulo = (width()-2) % 7; |
466 | int rowModulo = (height()-2) % 6; | 466 | int rowModulo = (height()-2) % 6; |
467 | #if 0 | 467 | #if 0 |
468 | return 7*(y/daysize.height()) + (KOGlobals::self()->reverseLayout() ? | 468 | return 7*(y/daysize.height()) + (KOGlobals::self()->reverseLayout() ? |
469 | 6 - x/daysize.width() : x/daysize.width()); | 469 | 6 - x/daysize.width() : x/daysize.width()); |
470 | #endif | 470 | #endif |
471 | int xVal = (x-colModulo/2-2)/daysize.width(); | 471 | int xVal = (x-colModulo/2-2)/daysize.width(); |
472 | int yVal = (y-rowModulo/2-2)/daysize.height(); | 472 | int yVal = (y-rowModulo/2-2)/daysize.height(); |
473 | 473 | ||
474 | 474 | ||
475 | return 7*(yVal) + xVal; | 475 | return 7*(yVal) + xVal; |
476 | 476 | ||
477 | } | 477 | } |
478 | 478 | ||
479 | // ---------------------------------------------------------------------------- | 479 | // ---------------------------------------------------------------------------- |
480 | // M O U S E E V E N T H A N D L I N G | 480 | // M O U S E E V E N T H A N D L I N G |
481 | // ---------------------------------------------------------------------------- | 481 | // ---------------------------------------------------------------------------- |
482 | 482 | ||