Diffstat (limited to 'korganizer/kotodoviewitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/kotodoviewitem.cpp | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index 2822237..1edddac 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp @@ -203,15 +203,16 @@ void KOTodoViewItem::stateChange(bool state) // qDebug("KOTodoViewItem::stateChange "); // do not change setting on startup if ( m_init ) return; - qDebug("KOTodoViewItem::stateChange "); + if (isOn()!=state) { + setOn(state); + //qDebug("SETON "); + return; + } QString keyd = "=="; QString keyt = "=="; - + //qDebug("KOTodoViewItem::stateChange %s ", text(0).latin1()); mTodo->setCompleted(state); if (state) mTodo->setCompleted(QDateTime::currentDateTime()); - if (isOn()!=state) { - setOn(state); - } if (mTodo->hasDueDate()) { setText(3, mTodo->dtDueDateStr()); @@ -240,12 +241,19 @@ void KOTodoViewItem::stateChange(bool state) if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); else setSortKey(2,QString::number(99)); } - QListViewItem * myChild = firstChild(); - KOTodoViewItem *item; - while( myChild ) { - item = static_cast<KOTodoViewItem*>(myChild); - item->stateChange(state); - myChild = myChild->nextSibling(); + if ( state ) { + QListViewItem * myChild = firstChild(); + KOTodoViewItem *item; + while( myChild ) { + //qDebug("stateCH "); + item = static_cast<KOTodoViewItem*>(myChild); + item->stateChange(state); + myChild = myChild->nextSibling(); + } + } else { + QListViewItem * myChild = parent(); + if ( myChild ) + (static_cast<KOTodoViewItem*>(myChild))->stateChange(state); } mTodoView->modified(true); setMyPixmap(); |