-rw-r--r-- | korganizer/komonthview.cpp | 89 |
1 files changed, 56 insertions, 33 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 9344567..842f6eb 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -81,5 +81,8 @@ KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) #endif - new KNOWhatsThis(this); + mWT = new KNOWhatsThis(this); +} +KNoScrollListBox::~KNoScrollListBox() +{ + delete mWT; } - QString KNoScrollListBox::getWhatsThisText(QPoint p) @@ -310,16 +313,5 @@ void MonthViewCell::setDate( const QDate &date ) // kdDebug() << "MonthViewCell::setDate(): " << date.toString() << endl; - mDate = date; - QString text; - bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; - if ( KOGlobals::self()->calendarSystem()->day( date ) == 1 || (date.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { - text = KOGlobals::self()->calendarSystem()->monthName( date, true ) + " "; - mLabel->resize( mLabelBigSize ); - text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); - } else { - mLabel->resize( mLabelSize ); - text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); - } - mLabel->setText( text ); + @@ -394,3 +386,7 @@ void MonthViewCell::updateCell() { - + if ( !mMonthView->isUpdatePossible() ) + return; + if ( !isVisible() ){ + return; + } setPrimary( mDate.month()%2 ); @@ -403,2 +399,5 @@ void MonthViewCell::updateCell() mItemList->clear(); + + + #ifdef DESKTOP_VERSION @@ -417,3 +416,12 @@ void MonthViewCell::updateCell() Event *event; - for( event = events.first(); event; event = events.next() ) { + for( event = events.first(); event; event = events.next() ) { // for event + + if ( !(event->doesRecur() == Recurrence::rNone) ) { + if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) + continue; + else + if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) + continue; + } + if ( event->categories().contains("Holiday") || @@ -485,2 +493,3 @@ void MonthViewCell::updateCell() item->setMoreInfo( event->description().length() > 0 ); +#ifdef DESKTOP_VERSION Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, @@ -494,16 +503,6 @@ void MonthViewCell::updateCell() item->setReply(false); - bool insert = true; - if ( !(event->doesRecur() == Recurrence::rNone) ) { - if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) - insert = false; - else - if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) - insert = false; - - } - if ( insert ) { - mItemList->insertItem( item ); - tipText += "\n"; - } else - tipText = ""; +#endif + mItemList->insertItem( item ); + tipText += "\n"; + } @@ -559,5 +558,16 @@ void MonthViewCell::updateCell() setMyPalette(); + QString text; + bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; + if ( KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { + text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " "; + mLabel->resize( mLabelBigSize ); + text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); + } else { + mLabel->resize( mLabelSize ); + text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); + } + mLabel->setText( text ); resizeEvent( 0 ); // if ( isVisible()) - // qApp->processEvents(); + qApp->processEvents(); } @@ -640,2 +650,7 @@ void MonthViewCell::resizeEvent ( QResizeEvent * ) { + if ( !mMonthView->isUpdatePossible() ) + return; + if ( !isVisible() ){ + return; + } int size = height() - mLabel->height(); @@ -715,2 +730,3 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) { + updatePossible = false; mCells.setAutoDelete( true ); @@ -922,3 +938,6 @@ void KOMonthView::updateView() { - + static int iii = 0; + ++iii; + if ( !updatePossible ) + return; uint i; @@ -956,3 +975,3 @@ void KOMonthView::computeLayout() return; - + //qDebug("KOMonthView::computeLayout()------------------------------------ "); QFontMetrics fm ( mWeekLabels[0]->font() ); @@ -1034,2 +1053,6 @@ void KOMonthView::computeLayout() updateDayLabels(); + bool forceUpdate = !updatePossible; + updatePossible = true; + if ( forceUpdate ) + updateView(); } |