summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaitem.cpp
authorzautrix <zautrix>2005-08-22 16:28:08 (UTC)
committer zautrix <zautrix>2005-08-22 16:28:08 (UTC)
commit18780cc2342097b343ee2fa50c649f425ddaed34 (patch) (side-by-side diff)
tree6ea015c45835e96451cede982ac79a518141dd29 /korganizer/koagendaitem.cpp
parent4a5e2a487ee162c1e3d5ea0d1c8d4bd14a65efb9 (diff)
downloadkdepimpi-18780cc2342097b343ee2fa50c649f425ddaed34.zip
kdepimpi-18780cc2342097b343ee2fa50c649f425ddaed34.tar.gz
kdepimpi-18780cc2342097b343ee2fa50c649f425ddaed34.tar.bz2
fix for the lonng agenda float fix
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
@@ -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;
}
/*