-rw-r--r-- | korganizer/komonthview.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 7927307..8ee1363 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -677,193 +677,193 @@ int MonthViewCell::insertEvent(Event *event) int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); if ( event->recursOn( mDate.addDays( -days)) ) { prefix ="<-" ;multiday = 3; } } } else { if (mDate == event->dtStart().date()) { prefix ="->" ;multiday = 1; } else if (mDate == event->dtEnd().date()) { prefix ="<-" ;multiday = 3; } } if ( !event->doesFloat() ) { if ( mDate == event->dtStart().date () ) time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; else if ( mDate == event->dtEnd().date () ) time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; } text = time + event->summary(); if ( useToolTips ) mToolTipText += prefix + text; } else { if (event->doesFloat()) { text = event->summary(); if ( useToolTips ) mToolTipText += text; } else { text = KGlobal::locale()->formatTime(event->dtStart().time()); text += " " + event->summary(); if ( useToolTips ) mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); } } if ( useToolTips && ! event->location().isEmpty() ) { mToolTipText += " (" + event->location() +")"; } MonthViewItem *item ; if ( mAvailItemList.count() ) { item = mAvailItemList.first(); mAvailItemList.remove( item ); item->recycle( event, mDate, text ); } else { item = new MonthViewItem( event, mDate, text ); } QPalette pal; if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { QStringList categories = event->categories(); QString cat = categories.first(); if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { pal = getPalette(); if (cat.isEmpty()) { pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); } else { pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); } } else { if (cat.isEmpty()) { pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); } else { pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); } } } else { pal = mStandardPalette ; } item->setPalette( pal ); item->setRecur( event->recurrence()->doesRecur() ); item->setAlarm( event->isAlarmEnabled() && multiday < 2 ); item->setMoreInfo( event->description().length() > 0 ); #ifdef DESKTOP_VERSION Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, KOPrefs::instance()->email()); if ( me != 0 ) { if ( me->status() == Attendee::NeedsAction && me->RSVP()) item->setReply(true && multiday < 2); else item->setReply(false); } 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 ) { QListBoxItem* it = this->item ( i ); - if ( text < it->text() ) { + if ( it && text < it->text() ) { pos = i; break; } ++pos; } insertItem( item ,pos); } if ( useToolTips ) { mToolTip.append( mToolTipText ); } return mdayCount; } void MonthViewCell::insertTodo(Todo *todo) { setFocusPolicy(WheelFocus); QString text; if (todo->hasDueDate()) { if (!todo->doesFloat()) { text += KGlobal::locale()->formatTime(todo->dtDue().time()); text += " "; } } text += todo->summary(); MonthViewItem *item ; if ( mAvailItemList.count() ) { item = mAvailItemList.first(); mAvailItemList.remove( item ); item->recycle( todo, mDate, text ); } else { item = new MonthViewItem( todo, mDate, text ); } //MonthViewItem *item = new MonthViewItem( todo, mDate, text ); //item->setPalette( mStandardPalette ); QPalette pal; if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { QStringList categories = todo->categories(); QString cat = categories.first(); if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { pal = getPalette(); if (cat.isEmpty()) { pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); } else { pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); } } else { if (cat.isEmpty()) { pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); } else { pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); } } } else { pal = mStandardPalette ; } item->setPalette( pal ); item->setRecur( todo->recurrence()->doesRecur() ); item->setAlarm( todo->isAlarmEnabled() ); item->setMoreInfo( todo->description().length() > 0 ); insertItem( item , count()); #ifdef DESKTOP_VERSION mToolTip.append( text ); #endif } void MonthViewCell::repaintfinishUpdateCell() { MonthViewItem *mitem = (MonthViewItem*) firstItem (); while ( mitem ) { mitem->setBlockRepaint( false ); updateItem ( mitem ); mitem = (MonthViewItem *)mitem->next(); } } void MonthViewCell::finishUpdateCell() { #ifdef DESKTOP_VERSION if (mToolTip.count() > 0 ) { mToolTip.sort(); QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); } #endif //sort(); //setMyPalette(); setMyPalette(); resizeEvent( 0 ); } void MonthViewCell::updateCell() { if ( !mMonthView->isUpdatePossible() ) return; |