author | zautrix <zautrix> | 2005-10-27 23:22:36 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-10-27 23:22:36 (UTC) |
commit | cbda16d4966c7483d20d1b6b5a64c8af367ea732 (patch) (side-by-side diff) | |
tree | 47099fd5b318c47eb1d8fff3d8a3eef6e34f6f23 /korganizer | |
parent | d6d384e50cfd511866958e58cdd3adeb35ed1c4e (diff) | |
download | kdepimpi-cbda16d4966c7483d20d1b6b5a64c8af367ea732.zip kdepimpi-cbda16d4966c7483d20d1b6b5a64c8af367ea732.tar.gz kdepimpi-cbda16d4966c7483d20d1b6b5a64c8af367ea732.tar.bz2 |
us fix
-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 @@ -692,103 +692,111 @@ int MonthViewCell::insertEvent(Event *event) useToolTips = false; #endif QString mToolTipText; setFocusPolicy(WheelFocus); if ( !(event->doesRecur() == Recurrence::rNone) ) { if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) return mdayCount; else if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) return mdayCount; } if ( event->isHoliday()) { setHoliday( true ); if ( mDate.dayOfWeek() == 7 ) setLineWidth( 3 ); } QString text; int multiday = 0;// 1 = start, 2 = midddle, 3 = end day if (event->isMultiDay()) { QString prefix = "<->";multiday = 2; QString time; if ( event->doesRecur() ) { if ( event->recursOn( mDate) ) { prefix ="->" ;multiday = 1; } else { int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); if ( event->recursOn( mDate.addDays( -days)) ) { prefix ="<-" ;multiday = 3; } } } else { if (mDate == event->dtStart().date()) { prefix ="->" ;multiday = 1; } else if (mDate == event->dtEnd().date()) { prefix ="<-" ;multiday = 3; } } if ( !event->doesFloat() ) { if ( mDate == event->dtStart().date () ) time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; else if ( mDate == event->dtEnd().date () ) time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; } text = time + event->summary(); + + int dur = 0; + if ( event->doesFloat() ) { + dur = event->dtStart().daysTo(event->dtEnd())+1; + + } if ( useToolTips ) { mToolTipText += prefix + text; - if ( event->doesFloat() ) { - mToolTipText += i18n(" (Duration: %1 days)" ).arg ( event->dtStart().daysTo(event->dtEnd())+1); - + if ( dur ) { + mToolTipText += i18n(" (Duration: %1 days)" ).arg ( dur ); } } + if ( dur ) { + text += " ("+ QString::number( dur ) + i18n(" days" ) + ")"; + } } else { if (event->doesFloat()) { text = event->summary(); if ( useToolTips ) mToolTipText += text; } else { text = KGlobal::locale()->formatTime(event->dtStart().time()); text += " " + event->summary(); if ( useToolTips ) mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); } } if ( useToolTips && ! event->location().isEmpty() ) { mToolTipText += " (" + event->location() +")"; } MonthViewItem *item ; if ( mAvailItemList.count() ) { item = mAvailItemList.first(); mAvailItemList.remove( item ); item->recycle( event, text ); } else { item = new MonthViewItem( event, text ); } QPalette pal; if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { QStringList categories = event->categories(); QString cat = categories.first(); if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { pal = getPalette(); if (cat.isEmpty()) { //pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->defaultColor( event->calID() )); } else { pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); } } else { if (cat.isEmpty()) { //pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); pal = QPalette( KOPrefs::instance()->defaultColor( event->calID() ), KOPrefs::instance()->defaultColor( event->calID() )); } else { pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); } } |