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, 4 insertions, 4 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 7e6fa48..82d1eab 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -483,57 +483,57 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e )
globalFlagBlockAgendaItemUpdate = 1;
}
int rx, ry, rw, rh;
rx = e->rect().x();
ry = e->rect().y();
rw = e->rect().width();
rh = e->rect().height();
//qDebug(" paintevent %s %d %d %d %d", mIncidence->summary().latin1(), x(), yy, width(), height());
QPixmap* paintFrom ;
if ( mSelected ) {
paintFrom = paintPixSel();
} else {
if ( mAllDay )
paintFrom = paintPixAllday();
else
paintFrom = paintPix();
}
xx += rx;
if ( xx < 0 ) {
rw = rw + xx;
rx -= xx;
xx = 0;
- if ( rw < 0 ) {
- qDebug("KOAgendaItem::Width1 < 0. Returning ");
+ if ( rw <= 1 ) {
+ qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1());
return;
}
}
if ( paintFrom->width() < xx+rw ) {
rw = paintFrom->width() - xx;
- if ( rw < 0 ) {
- qDebug("KOAgendaItem::Width2 < 0. Returning ");
+ if ( rw <= 1 ) {
+ qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() );
return;
}
}
//qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh);
bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP);
}
void KOAgendaItem::computeText()
{
mDisplayedText = mIncidence->summary();
if ( (mIncidence->type() == "Todo") ) {
if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) {
if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() )
mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")";
else if ( !(mIncidence->doesFloat()))
mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")";
}
} else {
if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda)
mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ;
if ( mAllDay ) {
if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) {
mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ;