From 2a788f41ebeb7d8edab7010fb1a00799cb9e036d Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 15 Jun 2005 16:07:02 +0000 Subject: fixxx --- (limited to 'korganizer/komonthview.cpp') diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 2150654..475bb4a 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -317,20 +317,27 @@ void MonthViewItem::paint(QPainter *p) #endif + int heihei = height( listBox () ); + int x = 1; if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { p->setBackgroundColor( palette().color( QPalette::Normal, \ sel ? QColorGroup::Highlight : QColorGroup::Background ) ); - p->eraseRect( 0, 0, listBox()->maxItemWidth(), height( listBox() ) ); + p->eraseRect( 0, 0, listBox()->maxItemWidth(), heihei ); } - int x = 1; + //int y = 3;//(height() - mRecurPixmap.height()) /2; int size = PIXMAP_SIZE; if ( QApplication::desktop()->width() < 300 ) size = 3; - int heihei = height( listBox () ); int y = (heihei - size -1 ) /2; + if ( mIncidence->calID() > 1 ) { + p->fillRect ( x, y-2,size,size+4, KOPrefs::instance()->defaultColor( mIncidence->calID() ) ); + p->drawRect ( x, y-2,size,size+4); + x += size + 1; + } + if ( KOPrefs::instance()->mMonthShowIcons ) { if ( mInfo ) { p->fillRect ( x, y,size,size, Qt::darkGreen ); @@ -610,6 +617,7 @@ void MonthViewCell::startUpdateCell() mAvailItemList.setAutoDelete( true ); mAvailItemList.clear(); mAvailItemList.setAutoDelete( false ); + clear(); } setPrimary( mDate.month()%2 ); @@ -763,14 +771,21 @@ int MonthViewCell::insertEvent(Event *event) } else item->setReply(false); #endif + item->setMultiDay( multiday ); if ( multiday ) { insertItem( item ,mdayCount); ++mdayCount; } else { - uint i; - int pos = mdayCount; - for ( i = mdayCount; i < count();++i ) { + uint i = mdayCount; + uint pos = mdayCount; + uint itcount = count(); + if ( itcount > 1000 ) { + qDebug("KO: Bug in MonthViewCell::insertEvent %u ", itcount); + itcount = 0; + } + for ( i = pos; i < itcount;++i ) { + // qDebug("i %d mday %u count %d ",i,itcount,mdayCount ); QListBoxItem* it = this->item ( i ); if ( it && text < it->text() ) { pos = i; -- cgit v0.9.0.2