summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaitem.cpp
Unidiff
Diffstat (limited to 'korganizer/koagendaitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 7a685d8..81681df 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -579,13 +579,14 @@ void KOAgendaItem::computeText()
579 579
580 if ( mAllDay ) { 580 if ( mAllDay ) {
581 if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) { 581 if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) {
582 if ( mIncidence->doesRecur() ) { 582 if ( mIncidence->doesRecur() ) {
583 mDisplayedText += " (" + mIncidence->recurrence()->recurrenceText() + ")"; 583 mDisplayedText += " (" + mIncidence->recurrence()->recurrenceText() + ")";
584 } else { 584 } else {
585 mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ; 585 int dur = 1+ (static_cast<Event*>(mIncidence))->dtStart().date().daysTo( (static_cast<Event*>(mIncidence))->dtEnd().date() );
586 mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) + " ("+QString::number( dur )+i18n(" days") +")" ;
586 } 587 }
587 } 588 }
588 } 589 }
589 } 590 }
590 591
591 if ( !mIncidence->location().isEmpty() ) { 592 if ( !mIncidence->location().isEmpty() ) {
@@ -655,27 +656,28 @@ int KOAgendaItem::cellHeight()
655 mCellYTop = 0; 656 mCellYTop = 0;
656 } 657 }
657 return ret; 658 return ret;
658} 659}
659// it may be that allday agenda items have a needed width > 32000 660// it may be that allday agenda items have a needed width > 32000
660// this code is to fix this problem 661// this code is to fix this problem
661int KOAgendaItem::resizeMe( int grid, int wid, int hei ) 662int KOAgendaItem::resizeMe( int grid, int wid, int hei, bool invalidWidth )
662{ 663{
663 int diff = 0; 664 int diff = 0;
664 if ( mCellX < -3 && mAllDay ) { 665 if ( mCellX < -3 && mAllDay ) {
665 diff = (mCellX + 3) * -grid; 666 diff = (mCellX + 3) * -grid;
666 //qDebug("%s: cellX %d diff %d wid %d grid %d ", mDisplayedText.latin1(), mCellX, diff, wid, grid); 667 //qDebug("%s: cellX %d diff %d wid %d grid %d ", mDisplayedText.latin1(), mCellX, diff, wid, grid);
667 if ( diff >= wid ) { 668 if ( diff >= wid ) {
668 // qDebug("KOAgendaItem::resizeMe: diff >= wid: diff %d wid %d ", diff, wid); 669 // qDebug("KOAgendaItem::resizeMe: diff >= wid: diff %d wid %d ", diff, wid);
669 //diff = 0; 670 //diff = 0;
670 } 671 }
671 } 672 }
672 if ( wid == width() || diff >= wid ) 673 if ( (!invalidWidth && wid == width() ) || diff >= wid )
673 resize( wid, hei ); 674 resize( wid, hei );
674 else 675 else
675 resize( wid - diff, hei ); 676 resize( wid - diff, hei );
677 //qDebug("wid %d x %d ", width(), x());
676 return diff; 678 return diff;
677} 679}
678/* 680/*
679 Return height of item in units of agenda cells 681 Return height of item in units of agenda cells
680*/ 682*/
681int KOAgendaItem::cellWidth() 683int KOAgendaItem::cellWidth()