summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp13
-rw-r--r--korganizer/kotodoview.h2
2 files changed, 13 insertions, 2 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 );
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index 39976cf..d0788a9 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -258,5 +258,5 @@ class KOTodoView : public KOrg::BaseView
void storeCurrentItem();
void resetCurrentItem();
- Incidence * mCurItem, *mCurItemRootParent,*mCurItemAbove;
+ Incidence * mCurItem, *mCurItemRootParent, *mCurItemParent,*mCurItemAbove;
};