summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaitem.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koagendaitem.cpp') (more/less context) (show 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
@@ -582,7 +582,8 @@ void KOAgendaItem::computeText()
if ( mIncidence->doesRecur() ) {
mDisplayedText += " (" + mIncidence->recurrence()->recurrenceText() + ")";
} else {
- mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ;
+ int dur = 1+ (static_cast<Event*>(mIncidence))->dtStart().date().daysTo( (static_cast<Event*>(mIncidence))->dtEnd().date() );
+ 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") +")" ;
}
}
}
@@ -658,7 +659,7 @@ int KOAgendaItem::cellHeight()
}
// it may be that allday agenda items have a needed width > 32000
// this code is to fix this problem
-int KOAgendaItem::resizeMe( int grid, int wid, int hei )
+int KOAgendaItem::resizeMe( int grid, int wid, int hei, bool invalidWidth )
{
int diff = 0;
if ( mCellX < -3 && mAllDay ) {
@@ -669,10 +670,11 @@ int KOAgendaItem::resizeMe( int grid, int wid, int hei )
//diff = 0;
}
}
- if ( wid == width() || diff >= wid )
+ if ( (!invalidWidth && wid == width() ) || diff >= wid )
resize( wid, hei );
else
resize( wid - diff, hei );
+ //qDebug("wid %d x %d ", width(), x());
return diff;
}
/*