author | zautrix <zautrix> | 2005-04-05 09:30:00 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-05 09:30:00 (UTC) |
commit | 53d7ec81939a9cf7ea2f63f133c1b61b2e2a9216 (patch) (side-by-side diff) | |
tree | 8dfcb059271cbfd4e28425d85dea747aa998594d /korganizer/komonthview.cpp | |
parent | 768858848f466a726e2f50b777345976828cc2ff (diff) | |
download | kdepimpi-53d7ec81939a9cf7ea2f63f133c1b61b2e2a9216.zip kdepimpi-53d7ec81939a9cf7ea2f63f133c1b61b2e2a9216.tar.gz kdepimpi-53d7ec81939a9cf7ea2f63f133c1b61b2e2a9216.tar.bz2 |
fix
-rw-r--r-- | korganizer/komonthview.cpp | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 1ed288b..425496a 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -269,6 +269,7 @@ MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s) mAlarm = false; mReply = false; mInfo = false; + mdayPos = 0; isWeekItem = KOPrefs::instance()->mMonthViewWeek; //qDebug("NEWWWWWWWWWWWWW "); } @@ -281,7 +282,8 @@ void MonthViewItem::recycle( Incidence *incidence, QDate qd, const QString & s) mRecur = false; mAlarm = false; mReply = false; - mInfo = false; + mInfo = false; + mdayPos = 0; //qDebug("recucleeeeeeeeeeeeeeeee "); } @@ -570,7 +572,7 @@ void MonthViewCell::setHoliday( const QString &holiday ) void MonthViewCell::startUpdateCell() { - + mdayCount = 0; setFocusPolicy(NoFocus); if ( !mMonthView->isUpdatePossible() ) return; @@ -621,16 +623,16 @@ void MonthViewCell::startUpdateCell() #endif } -void MonthViewCell::insertEvent(Event *event) +int MonthViewCell::insertEvent(Event *event) { QString mToolTipText; setFocusPolicy(WheelFocus); if ( !(event->doesRecur() == Recurrence::rNone) ) { if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) - return; + return mdayCount; else if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) - return; + return mdayCount; } if ( event->isHoliday()) { @@ -730,8 +732,24 @@ void MonthViewCell::insertEvent(Event *event) item->setReply(false); #endif item->setMultiDay( multiday ); - insertItem( item ); + 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() ) { + pos = i; + break; + } + ++pos; + } + insertItem( item ,pos); + } mToolTip.append( mToolTipText ); + return mdayCount; } void MonthViewCell::insertTodo(Todo *todo) { @@ -781,7 +799,7 @@ void MonthViewCell::insertTodo(Todo *todo) item->setRecur( todo->recurrence()->doesRecur() ); item->setAlarm( todo->isAlarmEnabled() ); item->setMoreInfo( todo->description().length() > 0 ); - insertItem( item ); + insertItem( item , count()); mToolTip.append( text ); } void MonthViewCell::repaintfinishUpdateCell() @@ -804,7 +822,7 @@ void MonthViewCell::finishUpdateCell() QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); } #endif - sort(); + //sort(); //setMyPalette(); setMyPalette(); |