-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 | |||
@@ -724,39 +724,47 @@ int MonthViewCell::insertEvent(Event *event) | |||
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 | } |