author | zautrix <zautrix> | 2004-10-16 23:34:27 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-16 23:34:27 (UTC) |
commit | 9f0a9fb68e70c53593f9cd8340a8bb16d7f6833f (patch) (unidiff) | |
tree | 126ad880390f2fd3d1fcbebf34c64e0a3f55d682 /korganizer | |
parent | 6564856660d583425a5f5d51bf77bc52c01da444 (diff) | |
download | kdepimpi-9f0a9fb68e70c53593f9cd8340a8bb16d7f6833f.zip kdepimpi-9f0a9fb68e70c53593f9cd8340a8bb16d7f6833f.tar.gz kdepimpi-9f0a9fb68e70c53593f9cd8340a8bb16d7f6833f.tar.bz2 |
todo fix
-rw-r--r-- | korganizer/kotodoview.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index a8143a0..a12acd1 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -499,25 +499,25 @@ void KOTodoView::jumpToDate () | |||
499 | void KOTodoView::setNarrow() | 499 | void KOTodoView::setNarrow() |
500 | { | 500 | { |
501 | //mTodoListView->setColumnWidth( 0, 120 ); | 501 | //mTodoListView->setColumnWidth( 0, 120 ); |
502 | mTodoListView->setColumnWidth( 1, 35 ); | 502 | mTodoListView->setColumnWidth( 1, 35 ); |
503 | mTodoListView->setColumnWidth( 2, 40 ); | 503 | mTodoListView->setColumnWidth( 2, 40 ); |
504 | mTodoListView->setColumnWidth( 3, 80 ); | 504 | mTodoListView->setColumnWidth( 3, 80 ); |
505 | mTodoListView->setColumnWidth( 4, 40 ); | 505 | mTodoListView->setColumnWidth( 4, 40 ); |
506 | mTodoListView->setColumnWidth( 5, 90 ); | 506 | mTodoListView->setColumnWidth( 5, 90 ); |
507 | 507 | ||
508 | } | 508 | } |
509 | void KOTodoView::updateView() | 509 | void KOTodoView::updateView() |
510 | { | 510 | { |
511 | 511 | pendingSubtodo = 0; | |
512 | if ( mBlockUpdate ) { | 512 | if ( mBlockUpdate ) { |
513 | //qDebug("blocked "); | 513 | //qDebug("blocked "); |
514 | return; | 514 | return; |
515 | } | 515 | } |
516 | //qDebug("update "); | 516 | //qDebug("update "); |
517 | // kdDebug() << "KOTodoView::updateView()" << endl; | 517 | // kdDebug() << "KOTodoView::updateView()" << endl; |
518 | QFont fo = KOPrefs::instance()->mTodoViewFont; | 518 | QFont fo = KOPrefs::instance()->mTodoViewFont; |
519 | mTodoListView->clear(); | 519 | mTodoListView->clear(); |
520 | if ( mName == "todolistsmall" ) { | 520 | if ( mName == "todolistsmall" ) { |
521 | if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { | 521 | if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { |
522 | int ps = fo.pointSize() -2; | 522 | int ps = fo.pointSize() -2; |
523 | if ( ps > 12 ) | 523 | if ( ps > 12 ) |
@@ -593,40 +593,41 @@ void KOTodoView::updateView() | |||
593 | } | 593 | } |
594 | //qDebug("for end "); | 594 | //qDebug("for end "); |
595 | // Restore opened/closed state | 595 | // Restore opened/closed state |
596 | mTodoListView->blockSignals( true ); | 596 | mTodoListView->blockSignals( true ); |
597 | if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() ); | 597 | if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() ); |
598 | mTodoListView->blockSignals( false ); | 598 | mTodoListView->blockSignals( false ); |
599 | mTodoListView->setFocus(); | 599 | mTodoListView->setFocus(); |
600 | processSelectionChange(); | 600 | processSelectionChange(); |
601 | } | 601 | } |
602 | 602 | ||
603 | void KOTodoView::restoreItemState( QListViewItem *item ) | 603 | void KOTodoView::restoreItemState( QListViewItem *item ) |
604 | { | 604 | { |
605 | pendingSubtodo = 0; | ||
605 | while( item ) { | 606 | while( item ) { |
606 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; | 607 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; |
607 | todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) ); | 608 | todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) ); |
608 | if( item->childCount() > 0 ) restoreItemState( item->firstChild() ); | 609 | if( item->childCount() > 0 ) restoreItemState( item->firstChild() ); |
609 | item = item->nextSibling(); | 610 | item = item->nextSibling(); |
610 | } | 611 | } |
611 | } | 612 | } |
612 | 613 | ||
613 | 614 | ||
614 | QMap<Todo *,KOTodoViewItem *>::ConstIterator | 615 | QMap<Todo *,KOTodoViewItem *>::ConstIterator |
615 | KOTodoView::insertTodoItem(Todo *todo) | 616 | KOTodoView::insertTodoItem(Todo *todo) |
616 | { | 617 | { |
617 | // kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl; | 618 | // kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl; |
618 | // TODO: Check, if dynmaic cast is necessary | 619 | // TODO: Check, if dynmaic cast is necessary |
619 | 620 | ||
620 | 621 | pendingSubtodo = 0; | |
621 | Incidence *incidence = todo->relatedTo(); | 622 | Incidence *incidence = todo->relatedTo(); |
622 | if (incidence && incidence->type() == "Todo") { | 623 | if (incidence && incidence->type() == "Todo") { |
623 | Todo *relatedTodo = static_cast<Todo *>(incidence); | 624 | Todo *relatedTodo = static_cast<Todo *>(incidence); |
624 | 625 | ||
625 | // kdDebug() << " has Related" << endl; | 626 | // kdDebug() << " has Related" << endl; |
626 | QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; | 627 | QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; |
627 | itemIterator = mTodoMap.find(relatedTodo); | 628 | itemIterator = mTodoMap.find(relatedTodo); |
628 | if (itemIterator == mTodoMap.end()) { | 629 | if (itemIterator == mTodoMap.end()) { |
629 | // kdDebug() << " related not yet in list" << endl; | 630 | // kdDebug() << " related not yet in list" << endl; |
630 | itemIterator = insertTodoItem (relatedTodo); | 631 | itemIterator = insertTodoItem (relatedTodo); |
631 | } | 632 | } |
632 | // isn't this pretty stupid? We give one Todo to the KOTodoViewItem | 633 | // isn't this pretty stupid? We give one Todo to the KOTodoViewItem |
@@ -696,24 +697,25 @@ void KOTodoView::editItem(QListViewItem *item ) | |||
696 | { | 697 | { |
697 | // qDebug("editItem(QListViewItem *item ) "); | 698 | // qDebug("editItem(QListViewItem *item ) "); |
698 | emit editTodoSignal(((KOTodoViewItem *)item)->todo()); | 699 | emit editTodoSignal(((KOTodoViewItem *)item)->todo()); |
699 | } | 700 | } |
700 | 701 | ||
701 | void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) | 702 | void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) |
702 | { | 703 | { |
703 | emit showTodoSignal(((KOTodoViewItem *)item)->todo()); | 704 | emit showTodoSignal(((KOTodoViewItem *)item)->todo()); |
704 | } | 705 | } |
705 | 706 | ||
706 | void KOTodoView::popupMenu(QListViewItem *item,const QPoint &,int column) | 707 | void KOTodoView::popupMenu(QListViewItem *item,const QPoint &,int column) |
707 | { | 708 | { |
709 | pendingSubtodo = 0; | ||
708 | mActiveItem = (KOTodoViewItem *)item; | 710 | mActiveItem = (KOTodoViewItem *)item; |
709 | if (item) { | 711 | if (item) { |
710 | switch (column){ | 712 | switch (column){ |
711 | case 1: | 713 | case 1: |
712 | mPriorityPopupMenu->popup(QCursor::pos ()); break; | 714 | mPriorityPopupMenu->popup(QCursor::pos ()); break; |
713 | case 2: | 715 | case 2: |
714 | mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; | 716 | mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; |
715 | case 3: | 717 | case 3: |
716 | moveTodo(); | 718 | moveTodo(); |
717 | break; | 719 | break; |
718 | case 6: | 720 | case 6: |
719 | getCategoryPopupMenu((KOTodoViewItem *)item)->popup(QCursor::pos ()); break; | 721 | getCategoryPopupMenu((KOTodoViewItem *)item)->popup(QCursor::pos ()); break; |