-rw-r--r-- | korganizer/komonthview.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 4bf9dea..004ff50 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -489,26 +489,26 @@ void MonthViewCell::startUpdateCell() mItemList->setLineWidth( 1 ); } mItemList->clear(); #ifdef DESKTOP_VERSION QToolTip::remove(this); -#endif - mToolTip = ""; +#endif + mToolTip.clear(); //qApp->processEvents(); if ( !mHolidayString.isEmpty() ) { MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); item->setPalette( mHolidayPalette ); mItemList->insertItem( item ); - mToolTip += mHolidayString+"\n"; + mToolTip.append ( mHolidayString ); } } void MonthViewCell::insertEvent(Event *event) { - + QString mToolTipText; mItemList->setFocusPolicy(WheelFocus); if ( !(event->doesRecur() == Recurrence::rNone) ) { if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) return; else if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) @@ -549,22 +549,22 @@ void MonthViewCell::insertEvent(Event *event) time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; else if ( mDate == event->dtEnd().date () ) time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; } text = time + event->summary(); - mToolTip += prefix + text; + mToolTipText += prefix + text; } else { if (event->doesFloat()) { text = event->summary(); - mToolTip += text; + mToolTipText += text; } else { text = KGlobal::locale()->formatTime(event->dtStart().time()); text += " " + event->summary(); - mToolTip += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); + mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); } } MonthViewItem *item = new MonthViewItem( event, mDate, text ); QPalette pal; if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { @@ -603,13 +603,13 @@ void MonthViewCell::insertEvent(Event *event) item->setReply(false); } else item->setReply(false); #endif item->setMultiDay( multiday ); mItemList->insertItem( item ); - mToolTip += "\n"; + mToolTip.append( mToolTipText ); } void MonthViewCell::insertTodo(Todo *todo) { mItemList->setFocusPolicy(WheelFocus); QString text; if (todo->hasDueDate()) { @@ -647,19 +647,21 @@ void MonthViewCell::insertTodo(Todo *todo) } item->setPalette( pal ); item->setRecur( todo->recurrence()->doesRecur() ); item->setAlarm( todo->isAlarmEnabled() ); item->setMoreInfo( todo->description().length() > 0 ); mItemList->insertItem( item ); - mToolTip += text+"\n"; + mToolTip.append( text ); } void MonthViewCell::finishUpdateCell() { #ifdef DESKTOP_VERSION - if (mToolTip != "") - QToolTip::add(this,mToolTip,toolTipGroup(),""); + if (mToolTip.count() > 0 ) { + mToolTip.sort(); + QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); + } #endif mItemList->sort(); //setMyPalette(); setMyPalette(); QString text; bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; |