-rw-r--r-- | korganizer/komonthview.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 610aae6..85e9166 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -708,71 +708,79 @@ int MonthViewCell::insertEvent(Event *event) | |||
708 | } | 708 | } |
709 | QString text; | 709 | QString text; |
710 | int multiday = 0;// 1 = start, 2 = midddle, 3 = end day | 710 | int multiday = 0;// 1 = start, 2 = midddle, 3 = end day |
711 | if (event->isMultiDay()) { | 711 | if (event->isMultiDay()) { |
712 | QString prefix = "<->";multiday = 2; | 712 | QString prefix = "<->";multiday = 2; |
713 | QString time; | 713 | QString time; |
714 | if ( event->doesRecur() ) { | 714 | if ( event->doesRecur() ) { |
715 | if ( event->recursOn( mDate) ) { | 715 | if ( event->recursOn( mDate) ) { |
716 | prefix ="->" ;multiday = 1; | 716 | prefix ="->" ;multiday = 1; |
717 | } | 717 | } |
718 | else { | 718 | else { |
719 | int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); | 719 | int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); |
720 | if ( event->recursOn( mDate.addDays( -days)) ) { | 720 | if ( event->recursOn( mDate.addDays( -days)) ) { |
721 | prefix ="<-" ;multiday = 3; | 721 | prefix ="<-" ;multiday = 3; |
722 | } | 722 | } |
723 | } | 723 | } |
724 | 724 | ||
725 | } else { | 725 | } else { |
726 | if (mDate == event->dtStart().date()) { | 726 | if (mDate == event->dtStart().date()) { |
727 | prefix ="->" ;multiday = 1; | 727 | prefix ="->" ;multiday = 1; |
728 | } else if (mDate == event->dtEnd().date()) { | 728 | } else if (mDate == event->dtEnd().date()) { |
729 | prefix ="<-" ;multiday = 3; | 729 | prefix ="<-" ;multiday = 3; |
730 | } | 730 | } |
731 | } | 731 | } |
732 | if ( !event->doesFloat() ) { | 732 | if ( !event->doesFloat() ) { |
733 | if ( mDate == event->dtStart().date () ) | 733 | if ( mDate == event->dtStart().date () ) |
734 | time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; | 734 | time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; |
735 | else if ( mDate == event->dtEnd().date () ) | 735 | else if ( mDate == event->dtEnd().date () ) |
736 | time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; | 736 | time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; |
737 | 737 | ||
738 | } | 738 | } |
739 | text = time + event->summary(); | 739 | text = time + event->summary(); |
740 | |||
741 | int dur = 0; | ||
742 | if ( event->doesFloat() ) { | ||
743 | dur = event->dtStart().daysTo(event->dtEnd())+1; | ||
744 | |||
745 | } | ||
740 | if ( useToolTips ) { | 746 | if ( useToolTips ) { |
741 | mToolTipText += prefix + text; | 747 | mToolTipText += prefix + text; |
742 | if ( event->doesFloat() ) { | 748 | if ( dur ) { |
743 | mToolTipText += i18n(" (Duration: %1 days)" ).arg ( event->dtStart().daysTo(event->dtEnd())+1); | 749 | mToolTipText += i18n(" (Duration: %1 days)" ).arg ( dur ); |
744 | |||
745 | } | 750 | } |
746 | } | 751 | } |
752 | if ( dur ) { | ||
753 | text += " ("+ QString::number( dur ) + i18n(" days" ) + ")"; | ||
754 | } | ||
747 | } else { | 755 | } else { |
748 | if (event->doesFloat()) { | 756 | if (event->doesFloat()) { |
749 | text = event->summary(); | 757 | text = event->summary(); |
750 | if ( useToolTips ) | 758 | if ( useToolTips ) |
751 | mToolTipText += text; | 759 | mToolTipText += text; |
752 | } | 760 | } |
753 | else { | 761 | else { |
754 | text = KGlobal::locale()->formatTime(event->dtStart().time()); | 762 | text = KGlobal::locale()->formatTime(event->dtStart().time()); |
755 | text += " " + event->summary(); | 763 | text += " " + event->summary(); |
756 | if ( useToolTips ) | 764 | if ( useToolTips ) |
757 | mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); | 765 | mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); |
758 | } | 766 | } |
759 | } | 767 | } |
760 | if ( useToolTips && ! event->location().isEmpty() ) { | 768 | if ( useToolTips && ! event->location().isEmpty() ) { |
761 | mToolTipText += " (" + event->location() +")"; | 769 | mToolTipText += " (" + event->location() +")"; |
762 | } | 770 | } |
763 | MonthViewItem *item ; | 771 | MonthViewItem *item ; |
764 | 772 | ||
765 | if ( mAvailItemList.count() ) { | 773 | if ( mAvailItemList.count() ) { |
766 | item = mAvailItemList.first(); | 774 | item = mAvailItemList.first(); |
767 | mAvailItemList.remove( item ); | 775 | mAvailItemList.remove( item ); |
768 | item->recycle( event, text ); | 776 | item->recycle( event, text ); |
769 | } else { | 777 | } else { |
770 | item = new MonthViewItem( event, text ); | 778 | item = new MonthViewItem( event, text ); |
771 | } | 779 | } |
772 | 780 | ||
773 | QPalette pal; | 781 | QPalette pal; |
774 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { | 782 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { |
775 | QStringList categories = event->categories(); | 783 | QStringList categories = event->categories(); |
776 | QString cat = categories.first(); | 784 | QString cat = categories.first(); |
777 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 785 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
778 | pal = getPalette(); | 786 | pal = getPalette(); |