author | zautrix <zautrix> | 2005-02-13 17:05:02 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-13 17:05:02 (UTC) |
commit | 293271fe9e6a9061da329183f8f488d79580f7da (patch) (side-by-side diff) | |
tree | 3a0234eabdf58440a484e960b5eef912a63d0056 /korganizer/kotodoviewitem.cpp | |
parent | 0a33f91e166747406ca2ccb5819881feeecfdb40 (diff) | |
download | kdepimpi-293271fe9e6a9061da329183f8f488d79580f7da.zip kdepimpi-293271fe9e6a9061da329183f8f488d79580f7da.tar.gz kdepimpi-293271fe9e6a9061da329183f8f488d79580f7da.tar.bz2 |
todo rec fixes
Diffstat (limited to 'korganizer/kotodoviewitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/kotodoviewitem.cpp | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index 0e847c2..70f00c6 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp @@ -177,75 +177,113 @@ void KOTodoViewItem::setMyPixmap() QPixmap pPix = QPixmap( size, size ); if ( mTodo->description().length() > 0 ) { pixi.resize(size, pixSize+size); pPix.fill( Qt::darkGreen ); p.begin( &pixi ); p. drawPixmap ( 0, pixSize, pPix); p.end(); pixSize += size; } if ( mTodo->isAlarmEnabled() ) { pixi.resize(size, pixSize+size); pPix.fill( Qt::red ); p.begin( &pixi ); p. drawPixmap ( 0, pixSize, pPix); p.end(); pixSize += size; + } + if ( mTodo->doesRecur() ) { + pixi.resize(size, pixSize+size); + pPix.fill( Qt::blue ); + p.begin( &pixi ); + p. drawPixmap ( 0, pixSize, pPix); + p.end(); + pixSize += size; } // } if ( pixi.width() > 1 ) { setPixmap ( 0,pixi ) ; } else { setPixmap ( 0,QPixmap() ) ; } } void KOTodoViewItem::stateChange(bool state) { - // qDebug("KOTodoViewItem::stateChange "); + // qDebug("KOTodoViewItem::stateChange %d ", state); // do not change setting on startup if ( m_init ) return; if (isOn()!=state) { setOn(state); //qDebug("SETON "); return; } if ( mTodo->isCompleted() == state ) { //qDebug("STATECHANGE:nothing to do "); return; } QString keyd = "=="; QString keyt = "=="; //qDebug("KOTodoViewItem::stateChange %s ", text(0).latin1()); - mTodo->setCompleted(state); + if ( mTodo->doesRecur() ){ + QDateTime start = mTodo->dtStart(); + mTodo->setCompleted(state); + if ( start != mTodo->dtStart() ) { + if ( state && !mTodo->isCompleted() ) { + setOn( false ); + state = false; + } + } + } else + mTodo->setCompleted(state); + if (state) mTodo->setCompleted(QDateTime::currentDateTime()); if (mTodo->hasDueDate()) { setText(3, mTodo->dtDueDateStr()); QDate d = mTodo->dtDue().date(); keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); setSortKey(3,keyd); if (mTodo->doesFloat()) { setText(4,""); } else { setText(4,mTodo->dtDueTimeStr()); QTime t = mTodo->dtDue().time(); keyt.sprintf("%02d%02d",t.hour(),t.minute()); setSortKey(4,keyt); } } + if (mTodo->hasStartDate()) { + QString skeyt = "=="; + QString skeyd = "=="; + setText(5, mTodo->dtStartDateStr()); + QDate d = mTodo->dtStart().date(); + skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); + + if (mTodo->doesFloat()) { + setText(6,""); + } + else { + setText(6,mTodo->dtStartTimeStr()); + QTime t = mTodo->dtStart().time(); + skeyt.sprintf("%02d%02d",t.hour(),t.minute()); + + } + setSortKey(5,skeyd); + setSortKey(6,skeyt); + } if (mTodo->isCompleted()) setSortKey(1,QString::number(9)+keyd+keyt); else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); if (mTodo->percentComplete()<100) { if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); else setSortKey(2,QString::number(mTodo->percentComplete())); } else { if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); else setSortKey(2,QString::number(99)); } if ( state ) { QListViewItem * myChild = firstChild(); KOTodoViewItem *item; while( myChild ) { |