-rw-r--r-- | korganizer/komonthview.cpp | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 1ed288b..425496a 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -268,8 +268,9 @@ MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s) | |||
268 | mRecur = false; | 268 | mRecur = false; |
269 | mAlarm = false; | 269 | mAlarm = false; |
270 | mReply = false; | 270 | mReply = false; |
271 | mInfo = false; | 271 | mInfo = false; |
272 | mdayPos = 0; | ||
272 | isWeekItem = KOPrefs::instance()->mMonthViewWeek; | 273 | isWeekItem = KOPrefs::instance()->mMonthViewWeek; |
273 | //qDebug("NEWWWWWWWWWWWWW "); | 274 | //qDebug("NEWWWWWWWWWWWWW "); |
274 | } | 275 | } |
275 | void MonthViewItem::recycle( Incidence *incidence, QDate qd, const QString & s) | 276 | void MonthViewItem::recycle( Incidence *incidence, QDate qd, const QString & s) |
@@ -280,9 +281,10 @@ void MonthViewItem::recycle( Incidence *incidence, QDate qd, const QString & s) | |||
280 | mDate = qd; | 281 | mDate = qd; |
281 | mRecur = false; | 282 | mRecur = false; |
282 | mAlarm = false; | 283 | mAlarm = false; |
283 | mReply = false; | 284 | mReply = false; |
284 | mInfo = false; | 285 | mInfo = false; |
286 | mdayPos = 0; | ||
285 | //qDebug("recucleeeeeeeeeeeeeeeee "); | 287 | //qDebug("recucleeeeeeeeeeeeeeeee "); |
286 | } | 288 | } |
287 | 289 | ||
288 | void MonthViewItem::paint(QPainter *p) | 290 | void MonthViewItem::paint(QPainter *p) |
@@ -569,9 +571,9 @@ void MonthViewCell::setHoliday( const QString &holiday ) | |||
569 | } | 571 | } |
570 | 572 | ||
571 | void MonthViewCell::startUpdateCell() | 573 | void MonthViewCell::startUpdateCell() |
572 | { | 574 | { |
573 | 575 | mdayCount = 0; | |
574 | setFocusPolicy(NoFocus); | 576 | setFocusPolicy(NoFocus); |
575 | if ( !mMonthView->isUpdatePossible() ) | 577 | if ( !mMonthView->isUpdatePossible() ) |
576 | return; | 578 | return; |
577 | MonthViewItem *mitem = (MonthViewItem*) firstItem (); | 579 | MonthViewItem *mitem = (MonthViewItem*) firstItem (); |
@@ -620,18 +622,18 @@ void MonthViewCell::startUpdateCell() | |||
620 | } | 622 | } |
621 | #endif | 623 | #endif |
622 | } | 624 | } |
623 | 625 | ||
624 | void MonthViewCell::insertEvent(Event *event) | 626 | int MonthViewCell::insertEvent(Event *event) |
625 | { | 627 | { |
626 | QString mToolTipText; | 628 | QString mToolTipText; |
627 | setFocusPolicy(WheelFocus); | 629 | setFocusPolicy(WheelFocus); |
628 | if ( !(event->doesRecur() == Recurrence::rNone) ) { | 630 | if ( !(event->doesRecur() == Recurrence::rNone) ) { |
629 | if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) | 631 | if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) |
630 | return; | 632 | return mdayCount; |
631 | else | 633 | else |
632 | if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) | 634 | if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) |
633 | return; | 635 | return mdayCount; |
634 | } | 636 | } |
635 | 637 | ||
636 | if ( event->isHoliday()) { | 638 | if ( event->isHoliday()) { |
637 | setHoliday( true ); | 639 | setHoliday( true ); |
@@ -729,10 +731,26 @@ void MonthViewCell::insertEvent(Event *event) | |||
729 | } else | 731 | } else |
730 | item->setReply(false); | 732 | item->setReply(false); |
731 | #endif | 733 | #endif |
732 | item->setMultiDay( multiday ); | 734 | item->setMultiDay( multiday ); |
733 | insertItem( item ); | 735 | if ( multiday ) { |
736 | insertItem( item ,mdayCount); | ||
737 | ++mdayCount; | ||
738 | } else { | ||
739 | uint i; | ||
740 | int pos = mdayCount; | ||
741 | for ( i = mdayCount; i < count();++i ) { | ||
742 | QListBoxItem* it = this->item ( i ); | ||
743 | if ( text < it->text() ) { | ||
744 | pos = i; | ||
745 | break; | ||
746 | } | ||
747 | ++pos; | ||
748 | } | ||
749 | insertItem( item ,pos); | ||
750 | } | ||
734 | mToolTip.append( mToolTipText ); | 751 | mToolTip.append( mToolTipText ); |
752 | return mdayCount; | ||
735 | } | 753 | } |
736 | void MonthViewCell::insertTodo(Todo *todo) | 754 | void MonthViewCell::insertTodo(Todo *todo) |
737 | { | 755 | { |
738 | setFocusPolicy(WheelFocus); | 756 | setFocusPolicy(WheelFocus); |
@@ -780,9 +798,9 @@ void MonthViewCell::insertTodo(Todo *todo) | |||
780 | item->setPalette( pal ); | 798 | item->setPalette( pal ); |
781 | item->setRecur( todo->recurrence()->doesRecur() ); | 799 | item->setRecur( todo->recurrence()->doesRecur() ); |
782 | item->setAlarm( todo->isAlarmEnabled() ); | 800 | item->setAlarm( todo->isAlarmEnabled() ); |
783 | item->setMoreInfo( todo->description().length() > 0 ); | 801 | item->setMoreInfo( todo->description().length() > 0 ); |
784 | insertItem( item ); | 802 | insertItem( item , count()); |
785 | mToolTip.append( text ); | 803 | mToolTip.append( text ); |
786 | } | 804 | } |
787 | void MonthViewCell::repaintfinishUpdateCell() | 805 | void MonthViewCell::repaintfinishUpdateCell() |
788 | { | 806 | { |
@@ -803,9 +821,9 @@ void MonthViewCell::finishUpdateCell() | |||
803 | mToolTip.sort(); | 821 | mToolTip.sort(); |
804 | QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); | 822 | QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); |
805 | } | 823 | } |
806 | #endif | 824 | #endif |
807 | sort(); | 825 | //sort(); |
808 | //setMyPalette(); | 826 | //setMyPalette(); |
809 | setMyPalette(); | 827 | setMyPalette(); |
810 | 828 | ||
811 | resizeEvent( 0 ); | 829 | resizeEvent( 0 ); |