summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kotodoview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 395325c..935a5f5 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -732,4 +732,5 @@ void KOTodoView::storeCurrentItem()
mCurItem = 0;
mCurItemRootParent = 0;
+ mCurItemParent = 0;
mCurItemAbove = 0;
mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
@@ -740,4 +741,5 @@ void KOTodoView::storeCurrentItem()
mCurItemAbove = activeItemAbove->todo();
mCurItemRootParent = mCurItem;
+ mCurItemParent = mCurItemRootParent->relatedTo();
while ( mCurItemRootParent->relatedTo() != 0 )
mCurItemRootParent = mCurItemRootParent->relatedTo();
@@ -751,4 +753,5 @@ void KOTodoView::resetCurrentItem()
KOTodoViewItem* foundItem = 0;
KOTodoViewItem* foundItemRoot = 0;
+ KOTodoViewItem* foundItemParent = 0;
KOTodoViewItem* foundItemAbove = 0;
if ( mTodoListView->firstChild () ) {
@@ -762,10 +765,17 @@ void KOTodoView::resetCurrentItem()
foundItemAbove = item;
- } else if ( item->todo() == mCurItemRootParent ) {
+ }
+ if ( item->todo() == mCurItemRootParent ) {
foundItemRoot = item;
}
+ if ( item->todo() == mCurItemParent ) {
+ foundItemParent = item;
+ }
item = (KOTodoViewItem*)item->itemBelow();
}
if ( ! foundItem ) {
+ if ( foundItemParent ) {
+ foundItem = foundItemParent;
+ } else {
if ( foundItemRoot )
foundItem = foundItemRoot;
@@ -774,4 +784,5 @@ void KOTodoView::resetCurrentItem()
}
}
+ }
if ( foundItem ) {
mTodoListView->setCurrentItem( foundItem );