summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.cpp
authorzautrix <zautrix>2005-02-23 18:47:45 (UTC)
committer zautrix <zautrix>2005-02-23 18:47:45 (UTC)
commit31f24d21cd23bb7e4033e7ffa000e6c979133ce7 (patch) (side-by-side diff)
tree2fa81f67efc6544a3664e6039a9602ef6f3466b9 /korganizer/kotodoview.cpp
parentfaedffc5ce8391204e0340a21eaaf582319ac824 (diff)
downloadkdepimpi-31f24d21cd23bb7e4033e7ffa000e6c979133ce7.zip
kdepimpi-31f24d21cd23bb7e4033e7ffa000e6c979133ce7.tar.gz
kdepimpi-31f24d21cd23bb7e4033e7ffa000e6c979133ce7.tar.bz2
many focus fixes
Diffstat (limited to 'korganizer/kotodoview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp22
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
@@ -600,16 +600,21 @@ void KOTodoView::updateView()
//qDebug("KOTodoView::updateView() %x", this);
if ( isFlatDisplay ) {
displayAllFlat();
return;
}
//qDebug("update ");
// kdDebug() << "KOTodoView::updateView()" << endl;
QFont fo = KOPrefs::instance()->mTodoViewFont;
+ Incidence* oldInc = 0;
+ mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
+ if (mActiveItem)
+ oldInc = mActiveItem->todo();
+
mTodoListView->clear();
if ( mName == "todolistsmall" ) {
if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) {
int ps = fo.pointSize() -2;
if ( ps > 12 )
ps -= 2;
fo.setPointSize( ps );
}
@@ -681,16 +686,33 @@ void KOTodoView::updateView()
}
}
//qDebug("for end ");
// Restore opened/closed state
mTodoListView->blockSignals( true );
if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() );
mTodoListView->blockSignals( false );
mTodoListView->setFocus();
+ if ( mTodoListView->firstChild () ) {
+ if ( oldInc ) {
+ KOTodoViewItem* item = (KOTodoViewItem*)mTodoListView->firstChild ();
+ while ( item ) {
+ if ( item->todo() == oldInc ) {
+ mTodoListView->setCurrentItem( item );
+ mTodoListView->ensureItemVisible( item );
+ break;
+ }
+ item = (KOTodoViewItem*)item->itemBelow();
+ }
+ if ( ! item )
+ mTodoListView->setCurrentItem( mTodoListView->firstChild () );
+ } else {
+ mTodoListView->setCurrentItem( mTodoListView->firstChild () );
+ }
+ }
processSelectionChange();
}
bool KOTodoView::checkTodo( Todo * todo )
{
if ( !KOPrefs::instance()->mShowCompletedTodo && todo->isCompleted() )
return false;