-rw-r--r-- | korganizer/kotodoview.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 395325c..935a5f5 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -733,2 +733,3 @@ void KOTodoView::storeCurrentItem() mCurItemRootParent = 0; + mCurItemParent = 0; mCurItemAbove = 0; @@ -741,2 +742,3 @@ void KOTodoView::storeCurrentItem() mCurItemRootParent = mCurItem; + mCurItemParent = mCurItemRootParent->relatedTo(); while ( mCurItemRootParent->relatedTo() != 0 ) @@ -752,2 +754,3 @@ void KOTodoView::resetCurrentItem() KOTodoViewItem* foundItemRoot = 0; + KOTodoViewItem* foundItemParent = 0; KOTodoViewItem* foundItemAbove = 0; @@ -763,5 +766,9 @@ void KOTodoView::resetCurrentItem() - } else if ( item->todo() == mCurItemRootParent ) { + } + if ( item->todo() == mCurItemRootParent ) { foundItemRoot = item; } + if ( item->todo() == mCurItemParent ) { + foundItemParent = item; + } item = (KOTodoViewItem*)item->itemBelow(); @@ -769,6 +776,10 @@ void KOTodoView::resetCurrentItem() if ( ! foundItem ) { - if ( foundItemRoot ) - foundItem = foundItemRoot; - else - foundItem = foundItemAbove; + if ( foundItemParent ) { + foundItem = foundItemParent; + } else { + if ( foundItemRoot ) + foundItem = foundItemRoot; + else + foundItem = foundItemAbove; + } } |