-rw-r--r-- | korganizer/kotodoview.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 3483e95..5e8ea27 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -605,6 +605,11 @@ void KOTodoView::updateView() | |||
605 | //qDebug("update "); | 605 | //qDebug("update "); |
606 | // kdDebug() << "KOTodoView::updateView()" << endl; | 606 | // kdDebug() << "KOTodoView::updateView()" << endl; |
607 | QFont fo = KOPrefs::instance()->mTodoViewFont; | 607 | QFont fo = KOPrefs::instance()->mTodoViewFont; |
608 | Incidence* oldInc = 0; | ||
609 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | ||
610 | if (mActiveItem) | ||
611 | oldInc = mActiveItem->todo(); | ||
612 | |||
608 | mTodoListView->clear(); | 613 | mTodoListView->clear(); |
609 | if ( mName == "todolistsmall" ) { | 614 | if ( mName == "todolistsmall" ) { |
610 | if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { | 615 | if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { |
@@ -686,6 +691,23 @@ void KOTodoView::updateView() | |||
686 | if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() ); | 691 | if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() ); |
687 | mTodoListView->blockSignals( false ); | 692 | mTodoListView->blockSignals( false ); |
688 | mTodoListView->setFocus(); | 693 | mTodoListView->setFocus(); |
694 | if ( mTodoListView->firstChild () ) { | ||
695 | if ( oldInc ) { | ||
696 | KOTodoViewItem* item = (KOTodoViewItem*)mTodoListView->firstChild (); | ||
697 | while ( item ) { | ||
698 | if ( item->todo() == oldInc ) { | ||
699 | mTodoListView->setCurrentItem( item ); | ||
700 | mTodoListView->ensureItemVisible( item ); | ||
701 | break; | ||
702 | } | ||
703 | item = (KOTodoViewItem*)item->itemBelow(); | ||
704 | } | ||
705 | if ( ! item ) | ||
706 | mTodoListView->setCurrentItem( mTodoListView->firstChild () ); | ||
707 | } else { | ||
708 | mTodoListView->setCurrentItem( mTodoListView->firstChild () ); | ||
709 | } | ||
710 | } | ||
689 | processSelectionChange(); | 711 | processSelectionChange(); |
690 | } | 712 | } |
691 | 713 | ||