author | zautrix <zautrix> | 2005-06-13 13:57:22 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-13 13:57:22 (UTC) |
commit | 56de219c5ce910a470a01a0e5003d1a113837ef4 (patch) (side-by-side diff) | |
tree | 3393cb306cec8dcdc05d6ed0fae3ae7d374f2794 /korganizer/kotodoview.cpp | |
parent | 4f3ff02932b39bf16b9692c3cb69c101a28b4616 (diff) | |
download | kdepimpi-56de219c5ce910a470a01a0e5003d1a113837ef4.zip kdepimpi-56de219c5ce910a470a01a0e5003d1a113837ef4.tar.gz kdepimpi-56de219c5ce910a470a01a0e5003d1a113837ef4.tar.bz2 |
fixxx
-rw-r--r-- | korganizer/kotodoview.cpp | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 2602487..35c2a9f 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -702,8 +702,8 @@ void KOTodoView::updateView() // qDebug("todo %s ", todo->summary().latin1()); Incidence *incidence = todo->relatedTo(); - while ( incidence ) { + while ( incidence ) { if ( incidence->typeID() == todoID ) { //qDebug("related %s ",incidence->summary().latin1() ); - if ( !(todoList.contains ( ((Todo* )incidence ) ) )) { + if ( !(todoList.contains ( ((Todo* )incidence ) ) ) && incidence->calEnabled() ) { //qDebug("related not found "); todoList.remove( ); @@ -837,32 +837,34 @@ void KOTodoView::restoreItemState( QListViewItem *item ) QMap<Todo *,KOTodoViewItem *>::ConstIterator - KOTodoView::insertTodoItem(Todo *todo) +KOTodoView::insertTodoItem(Todo *todo) { -// kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl; - // TODO: Check, if dynmaic cast is necessary + // kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl; + // TODO: Check, if dynmaic cast is necessary pendingSubtodo = 0; - Incidence *incidence = todo->relatedTo(); - if (incidence && incidence->typeID() == todoID ) { - Todo *relatedTodo = static_cast<Todo *>(incidence); - -// kdDebug() << " has Related" << endl; - QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; - itemIterator = mTodoMap.find(relatedTodo); - if (itemIterator == mTodoMap.end()) { -// kdDebug() << " related not yet in list" << endl; - itemIterator = insertTodoItem (relatedTodo); + Incidence *incidence = todo->relatedTo(); + while ( incidence && !incidence->calEnabled() ) + incidence = incidence->relatedTo(); + if (incidence && incidence->typeID() == todoID ) { + Todo *relatedTodo = static_cast<Todo *>(incidence); + + // kdDebug() << " has Related" << endl; + QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; + itemIterator = mTodoMap.find(relatedTodo); + if (itemIterator == mTodoMap.end()) { + // kdDebug() << " related not yet in list" << endl; + itemIterator = insertTodoItem (relatedTodo); + } + // isn't this pretty stupid? We give one Todo to the KOTodoViewItem + // and one into the map. Sure finding is more easy but why? -zecke + KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this); + return mTodoMap.insert(todo,todoItem); + } else { + // kdDebug() << " no Related" << endl; + // see above -zecke + KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); + return mTodoMap.insert(todo,todoItem); } - // isn't this pretty stupid? We give one Todo to the KOTodoViewItem - // and one into the map. Sure finding is more easy but why? -zecke - KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this); - return mTodoMap.insert(todo,todoItem); - } else { -// kdDebug() << " no Related" << endl; - // see above -zecke - KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); - return mTodoMap.insert(todo,todoItem); - } } |