-rw-r--r-- | korganizer/koagendaview.cpp | 1 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 9 | ||||
-rw-r--r-- | korganizer/kotodoviewitem.cpp | 18 | ||||
-rw-r--r-- | libkcal/todo.cpp | 6 |
4 files changed, 27 insertions, 7 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index bbc43e4..42a6f7c 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -1163,3 +1163,2 @@ void KOAgendaView::fillAgenda() fillIn = ((todo->dtDue().date() == currentDate) && !overdue) || ((currentDate == today) && overdue); - qDebug("refill todo "); if ( fillIn ) { diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 14e8b5c..902f3f4 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -860,2 +860,11 @@ void KOTodoView::setNewPercentage(int index) if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { + + if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) { + mActiveItem->setOn( true ); + return; + } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) { + KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent())); + if ( par && par->isOn() ) + par->setOn( false ); + } if (mPercentage[index] == 100) { diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index 2822237..1edddac 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp @@ -205,11 +205,12 @@ void KOTodoViewItem::stateChange(bool state) 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); - } @@ -242,2 +243,3 @@ void KOTodoViewItem::stateChange(bool state) } + if ( state ) { QListViewItem * myChild = firstChild(); @@ -245,2 +247,3 @@ void KOTodoViewItem::stateChange(bool state) while( myChild ) { + //qDebug("stateCH "); item = static_cast<KOTodoViewItem*>(myChild); @@ -249,2 +252,7 @@ void KOTodoViewItem::stateChange(bool state) } + } else { + QListViewItem * myChild = parent(); + if ( myChild ) + (static_cast<KOTodoViewItem*>(myChild))->stateChange(state); + } mTodoView->modified(true); diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 7d04793..7f1de78 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp @@ -309,3 +309,7 @@ void Todo::setCompleted(const QDateTime &completed) { - qDebug("Todo::setCompleted "); + //qDebug("Todo::setCompleted "); + if ( mHasCompletedDate ) { + // qDebug("has completed data - return "); + return; + } mHasCompletedDate = true; |