summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaitem.cpp
Unidiff
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 )
483 globalFlagBlockAgendaItemUpdate = 1; 483 globalFlagBlockAgendaItemUpdate = 1;
484 } 484 }
485 int rx, ry, rw, rh; 485 int rx, ry, rw, rh;
486 rx = e->rect().x(); 486 rx = e->rect().x();
487 ry = e->rect().y(); 487 ry = e->rect().y();
488 rw = e->rect().width(); 488 rw = e->rect().width();
489 rh = e->rect().height(); 489 rh = e->rect().height();
490 //qDebug(" paintevent %s %d %d %d %d", mIncidence->summary().latin1(), x(), yy, width(), height()); 490 //qDebug(" paintevent %s %d %d %d %d", mIncidence->summary().latin1(), x(), yy, width(), height());
491 491
492 QPixmap* paintFrom ; 492 QPixmap* paintFrom ;
493 if ( mSelected ) { 493 if ( mSelected ) {
494 paintFrom = paintPixSel(); 494 paintFrom = paintPixSel();
495 } else { 495 } else {
496 if ( mAllDay ) 496 if ( mAllDay )
497 paintFrom = paintPixAllday(); 497 paintFrom = paintPixAllday();
498 else 498 else
499 paintFrom = paintPix(); 499 paintFrom = paintPix();
500 } 500 }
501 xx += rx; 501 xx += rx;
502 502
503 if ( xx < 0 ) { 503 if ( xx < 0 ) {
504 rw = rw + xx; 504 rw = rw + xx;
505 rx -= xx; 505 rx -= xx;
506 xx = 0; 506 xx = 0;
507 if ( rw < 0 ) { 507 if ( rw <= 1 ) {
508 qDebug("KOAgendaItem::Width1 < 0. Returning "); 508 qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1());
509 return; 509 return;
510 } 510 }
511 } 511 }
512 if ( paintFrom->width() < xx+rw ) { 512 if ( paintFrom->width() < xx+rw ) {
513 rw = paintFrom->width() - xx; 513 rw = paintFrom->width() - xx;
514 if ( rw < 0 ) { 514 if ( rw <= 1 ) {
515 qDebug("KOAgendaItem::Width2 < 0. Returning "); 515 qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() );
516 return; 516 return;
517 } 517 }
518 } 518 }
519 //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); 519 //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh);
520 bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP); 520 bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP);
521} 521}
522void KOAgendaItem::computeText() 522void KOAgendaItem::computeText()
523{ 523{
524 524
525 mDisplayedText = mIncidence->summary(); 525 mDisplayedText = mIncidence->summary();
526 if ( (mIncidence->type() == "Todo") ) { 526 if ( (mIncidence->type() == "Todo") ) {
527 if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) { 527 if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) {
528 if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) 528 if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() )
529 mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; 529 mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")";
530 else if ( !(mIncidence->doesFloat())) 530 else if ( !(mIncidence->doesFloat()))
531 mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; 531 mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")";
532 } 532 }
533 } else { 533 } else {
534 if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda) 534 if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda)
535 mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ; 535 mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ;
536 536
537 if ( mAllDay ) { 537 if ( mAllDay ) {
538 if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) { 538 if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) {
539 mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ; 539 mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ;