summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp22
-rw-r--r--korganizer/kotodoview.h1
2 files changed, 15 insertions, 8 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 8d354c8..e2966f8 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -749,11 +749,10 @@ void KOTodoView::updateView()
return;
}
- storeCurrentItem();
//qDebug("KOTodoView::updateView() %x", this);
if ( isFlatDisplay ) {
displayAllFlat();
- resetCurrentItem();
return;
}
+ storeCurrentItem();
//qDebug("update ");
// kdDebug() << "KOTodoView::updateView()" << endl;
@@ -836,5 +835,4 @@ void KOTodoView::updateView()
mTodoListView->blockSignals( false );
resetCurrentItem();
- processSelectionChange();
}
@@ -861,5 +859,5 @@ void KOTodoView::storeCurrentItem()
void KOTodoView::resetCurrentItem()
{
- mTodoListView->setFocus();
+ //mTodoListView->setFocus();
KOTodoViewItem* foundItem = 0;
KOTodoViewItem* foundItemRoot = 0;
@@ -897,10 +895,20 @@ void KOTodoView::resetCurrentItem()
}
if ( foundItem ) {
+ mTodoListView->setSelected ( foundItem, true );
mTodoListView->setCurrentItem( foundItem );
mTodoListView->ensureItemVisible( foundItem );
} else {
+ if ( mTodoListView->firstChild () ) {
+ mTodoListView->setSelected ( mTodoListView->firstChild (), true );
mTodoListView->setCurrentItem( mTodoListView->firstChild () );
}
}
+ }
+ processSelectionChange();
+ QTimer::singleShot( 100, this, SLOT ( resetFocusToList() ));
+}
+void KOTodoView::resetFocusToList()
+{
+ topLevelWidget()->setActiveWindow();
mTodoListView->setFocus();
}
@@ -1405,4 +1413,5 @@ void KOTodoView::setOpen( QListViewItem* item, bool setOpenI)
void KOTodoView::displayAllFlat()
{
+ storeCurrentItem();
pendingSubtodo = 0;
if ( mBlockUpdate ) {
@@ -1419,6 +1428,5 @@ void KOTodoView::displayAllFlat()
mTodoMap.insert(todo,todoItem);
}
- mTodoListView->setFocus();
- processSelectionChange();
+ resetCurrentItem();
}
@@ -1431,7 +1439,5 @@ void KOTodoView::setAllFlat()
return;
}
- storeCurrentItem();
displayAllFlat();
- resetCurrentItem();
}
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index 1b31d0d..9ae7f53 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -225,4 +225,5 @@ class KOTodoView : public KOrg::BaseView
void modified(bool);
void itemDoubleClicked(QListViewItem *item);
+ void resetFocusToList();
signals: