summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.cpp
Unidiff
Diffstat (limited to 'korganizer/komonthview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.cpp34
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
@@ -266,25 +266,27 @@ MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s)
266 mIncidence = incidence; 266 mIncidence = incidence;
267 mDate = qd; 267 mDate = qd;
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}
275void MonthViewItem::recycle( Incidence *incidence, QDate qd, const QString & s) 276void MonthViewItem::recycle( Incidence *incidence, QDate qd, const QString & s)
276{ 277{
277 setText( s ); 278 setText( s );
278 mMultiday = 0; 279 mMultiday = 0;
279 mIncidence = incidence; 280 mIncidence = incidence;
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
288void MonthViewItem::paint(QPainter *p) 290void MonthViewItem::paint(QPainter *p)
289{ 291{
290 if ( mblockRepaint ) { 292 if ( mblockRepaint ) {
@@ -567,13 +569,13 @@ void MonthViewCell::setHoliday( const QString &holiday )
567 setHoliday( true ); 569 setHoliday( true );
568 } 570 }
569} 571}
570 572
571void MonthViewCell::startUpdateCell() 573void 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 ();
578 while ( mitem ) { 580 while ( mitem ) {
579 mitem->setBlockRepaint( true ); 581 mitem->setBlockRepaint( true );
@@ -618,22 +620,22 @@ void MonthViewCell::startUpdateCell()
618 insertItem( item ); 620 insertItem( item );
619 mToolTip.append ( mHolidayString ); 621 mToolTip.append ( mHolidayString );
620 } 622 }
621#endif 623#endif
622} 624}
623 625
624void MonthViewCell::insertEvent(Event *event) 626int 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 );
638 if ( mDate.dayOfWeek() == 7 ) 640 if ( mDate.dayOfWeek() == 7 )
639 setLineWidth( 3 ); 641 setLineWidth( 3 );
@@ -727,14 +729,30 @@ void MonthViewCell::insertEvent(Event *event)
727 else 729 else
728 item->setReply(false); 730 item->setReply(false);
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}
736void MonthViewCell::insertTodo(Todo *todo) 754void MonthViewCell::insertTodo(Todo *todo)
737{ 755{
738 setFocusPolicy(WheelFocus); 756 setFocusPolicy(WheelFocus);
739 QString text; 757 QString text;
740 if (todo->hasDueDate()) { 758 if (todo->hasDueDate()) {
@@ -778,13 +796,13 @@ void MonthViewCell::insertTodo(Todo *todo)
778 pal = mStandardPalette ; 796 pal = mStandardPalette ;
779 } 797 }
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}
787void MonthViewCell::repaintfinishUpdateCell() 805void MonthViewCell::repaintfinishUpdateCell()
788{ 806{
789 MonthViewItem *mitem = (MonthViewItem*) firstItem (); 807 MonthViewItem *mitem = (MonthViewItem*) firstItem ();
790 while ( mitem ) { 808 while ( mitem ) {
@@ -801,13 +819,13 @@ void MonthViewCell::finishUpdateCell()
801#ifdef DESKTOP_VERSION 819#ifdef DESKTOP_VERSION
802 if (mToolTip.count() > 0 ) { 820 if (mToolTip.count() > 0 ) {
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 );
812 830
813} 831}